diaspora/config/environment.rb
Alec Leamas 8d218e7871 suburi cucumber test.
Adds the features/uri-features test directory, testing sub-uri
deployment. These tests uses script/server since much of this code is
about configuring the server.  They are not run by "rake cucumber", to
run them use "bundle exec rake cucumber features/uri-test".

Tests requires a working app_config.yml setup with pod_url =
"http://localhost:3000/diaspora"

Patches cucumber.yml to always load step definitions from features/**, see
http://thoughtsincomputation.com/posts/cucumber-step-definitions-and-autorequire-hell
2010-12-29 10:31:25 +01:00

31 lines
1.3 KiB
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
# Load the rails application
require File.expand_path('../application', __FILE__)
Haml::Template.options[:format] = :html5
Haml::Template.options[:escape_html] = true
ActionController::Base.config.relative_url_root = "/daspora"
if File.exists?(File.expand_path("./config/languages.yml"))
languages = YAML::load(File.open(File.expand_path("./config/languages.yml")))
AVAILABLE_LANGUAGES = (languages['available'].length > 0) ? languages['available'] : { :en => 'English' }
DEFAULT_LANGUAGE = (AVAILABLE_LANGUAGES.include?(languages['default'])) ? languages['default'] : AVAILABLE_LANGUAGES.keys[0].to_s
AVAILABLE_LANGUAGE_CODES = languages['available'].keys.map { |v| v.to_s }
else
AVAILABLE_LANGUAGES = { :en => 'English' }
DEFAULT_LANGUAGES = 'en'
AVAILABLE_LANGUAGE_CODES = ['en']
end
if File.exists?(File.expand_path("./config/langcodes_alias_map.yml"))
LANGUAGE_CODES_MAP = YAML::load(File.open(File.expand_path("./config/langcodes_alias_map.yml")))
else
LANGUAGE_CODES_MAP = {}
end
#config.action_controller.relative_url_root = "/diaspora"
# Initialize the rails application
Diaspora::Application.initialize!