Updates styles, translations page, links, etc
This commit is contained in:
+33
-26
@@ -6,6 +6,7 @@
|
||||
|
||||
require 'cucumber/rails'
|
||||
require 'capybara/poltergeist'
|
||||
require 'lingua_franca/capybara'
|
||||
|
||||
# Capybara defaults to CSS3 selectors rather than XPath.
|
||||
# If you'd prefer to use XPath, just uncomment this line and adjust any
|
||||
@@ -39,41 +40,41 @@ rescue NameError
|
||||
end
|
||||
|
||||
add_translations = Array.new
|
||||
Carmen::World.instance.subregions.each { |country|
|
||||
add_translations << "world.#{country.code.downcase}.name"
|
||||
if country.subregions?
|
||||
country.subregions.each { |region| add_translations << "world.#{country.code.downcase}.#{region.code.downcase}.name" }
|
||||
end
|
||||
}
|
||||
#Carmen::World.instance.subregions.each { |country|
|
||||
# add_translations << "world.#{country.code.downcase}.name"
|
||||
# if country.subregions?
|
||||
# country.subregions.each { |region| add_translations << "world.#{country.code.downcase}.#{region.code.downcase}.name" }
|
||||
# end
|
||||
#}
|
||||
|
||||
I18n::Backend::BikeBike::init_tests!# add_translations
|
||||
#I18n::Backend::BikeBike::init_tests!# add_translations
|
||||
|
||||
#at_exit do
|
||||
# I18n::Backend::BikeBike::end_tests!
|
||||
#end
|
||||
|
||||
Before('@javascript') do
|
||||
ActiveRecord::Base.shared_connection = nil
|
||||
ActiveRecord::Base.descendants.each do |model|
|
||||
model.shared_connection = nil
|
||||
end
|
||||
end
|
||||
#Before('@javascript') do
|
||||
# ActiveRecord::Base.shared_connection = nil
|
||||
# ActiveRecord::Base.descendants.each do |model|
|
||||
# model.shared_connection = nil
|
||||
# end
|
||||
#end
|
||||
|
||||
Before do
|
||||
#DatabaseCleaner.start
|
||||
Translation.connection.execute("INSERT INTO translations (locale, key, value) VALUES('en', 'time.formats.date', '%B %d, %Y');")
|
||||
Translation.connection.execute("INSERT INTO translations (locale, key, value, is_proc) VALUES('en', 'date.month_names', '[\"~\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]', TRUE);")
|
||||
ConferenceType.connection.execute("INSERT INTO conference_types (slug) VALUES ('bikebike'), ('regional'), ('bici-congreso')")
|
||||
WorkshopStream.connection.execute("INSERT INTO workshop_streams (slug) VALUES ('mechanics'), ('leisure'), ('interorganizational_relations'), ('ethics_public_relations'), ('organization_management')")
|
||||
WorkshopPresentationStyle.connection.execute("INSERT INTO workshop_presentation_styles (slug) VALUES ('discussion'), ('panel'), ('presentation'), ('hands-on'), ('other')")
|
||||
#Translation.connection.execute("INSERT INTO translations (locale, key, value) VALUES('en', 'time.formats.date', '%B %d, %Y');")
|
||||
#Translation.connection.execute("INSERT INTO translations (locale, key, value, is_proc) VALUES('en', 'date.month_names', '[\"~\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]', TRUE);")
|
||||
#ConferenceType.connection.execute("INSERT INTO conference_types (slug) VALUES ('bikebike'), ('regional'), ('bici-congreso')")
|
||||
#WorkshopStream.connection.execute("INSERT INTO workshop_streams (slug) VALUES ('mechanics'), ('leisure'), ('interorganizational_relations'), ('ethics_public_relations'), ('organization_management')")
|
||||
#WorkshopPresentationStyle.connection.execute("INSERT INTO workshop_presentation_styles (slug) VALUES ('discussion'), ('panel'), ('presentation'), ('hands-on'), ('other')")
|
||||
#host! 'en.bikebike.org'
|
||||
ApplicationController::set_host 'en.bikebike.org'
|
||||
ApplicationController::set_location nil
|
||||
end
|
||||
|
||||
After do |scenario|
|
||||
save_and_open_page if scenario.failed?
|
||||
end
|
||||
#After do |scenario|
|
||||
# save_and_open_page if scenario.failed?
|
||||
#end
|
||||
|
||||
#After do
|
||||
# DatabaseCleaner.clean
|
||||
@@ -97,12 +98,18 @@ end
|
||||
# Possible values are :truncation and :transaction
|
||||
# The :transaction strategy is faster, but might give you threading problems.
|
||||
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
||||
Cucumber::Rails::Database.javascript_strategy = :transaction
|
||||
Capybara.register_driver :poltergeist_debug do |app|
|
||||
Capybara::Poltergeist::Driver.new(app, :timeout => 120, inspector: true)
|
||||
#Cucumber::Rails::Database.javascript_strategy = :transaction
|
||||
#Capybara.register_driver :poltergeist_debug do |app|
|
||||
# Capybara::Poltergeist::Driver.new(app, :timeout => 120, inspector: true)
|
||||
#end
|
||||
#Capybara.javascript_driver = :lingua_franca_poltergeist
|
||||
#Geocoder.configure(:timeout => 60)
|
||||
|
||||
Capybara.configure do |c|
|
||||
c.run_server = true
|
||||
c.javascript_driver = :lingua_franca_poltergeist
|
||||
c.default_driver = :lingua_franca_poltergeist
|
||||
end
|
||||
Capybara.javascript_driver = :poltergeist_debug
|
||||
Geocoder.configure(:timeout => 60)
|
||||
|
||||
def locate(id)
|
||||
page.find('[id$="' + id.gsub(/\s+/, '_') + '"]')[:id]
|
||||
|
||||
@@ -3,7 +3,7 @@ module NavigationHelpers
|
||||
append_root = false
|
||||
case page_name
|
||||
when /^landing$/i
|
||||
path = :root
|
||||
path = :home
|
||||
when /^confirmation$/i
|
||||
path = "/conferences/bikebike/#{@last_conference.slug}/register/confirm/#{@last_registration.confirmation_token}"
|
||||
when /^registration$/i
|
||||
|
||||
Reference in New Issue
Block a user