Skip to content
Browse files

Added separate ci environment

  • Loading branch information...
1 parent 8a8d857 commit 295dccc47e4800692c87e8e769eb764bb3cb9fd3 @ludo committed Jul 29, 2011
Showing with 58 additions and 13 deletions.
  1. +4 −1 config/database.yml
  2. +39 −0 config/environments/ci.rb
  3. +15 −0 features/support/capybara.rb
  4. +0 −12 features/support/env.rb
View
5 config/database.yml
@@ -4,10 +4,13 @@ development:
pool: 5
timeout: 3000
-test:
+test: &test
adapter: postgresql
database: test_twatter
username: test_twatter
password: beheer
host: localhost
encoding: UTF8
+
+ci:
+ <<: *test
View
39 config/environments/ci.rb
@@ -0,0 +1,39 @@
+Twatter::Application.configure do
+ # Settings specified here will take precedence over those in config/application.rb
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Log error messages when you accidentally call methods on nil
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+end
View
15 features/support/capybara.rb
@@ -0,0 +1,15 @@
+if Rails.env.ci?
+ Capybara.server_port = 4000
+ Capybara.app_host = "http://ci1.amsterdam.viaviela.local:#{Capybara.server_port}"
+
+ # TODO Create some kind of platform selection tool, also see
+ # http://rdoc.info/gems/selenium-webdriver/2.2.0/Selenium/WebDriver/Remote/Capabilities
+ Capybara.default_driver = :selenium
+ Capybara.register_driver :selenium do |app|
+ Capybara::Selenium::Driver.new(app,
+ :browser => :remote,
+ :url => "http://ci2.amsterdam.viaviela.local:4444/wd/hub",
+ :desired_capabilities => :chrome
+ )
+ end
+end
View
12 features/support/env.rb
@@ -12,18 +12,6 @@
# steps to use the XPath syntax.
Capybara.default_selector = :css
-Capybara.server_port = 3000
-Capybara.app_host = "http://ci1.amsterdam.viaviela.local:#{Capybara.server_port}"
-
-Capybara.default_driver = :selenium
-Capybara.register_driver :selenium do |app|
- Capybara::Selenium::Driver.new(app,
- :browser => :remote,
- :url => "http://ci2.amsterdam.viaviela.local:4444/wd/hub"
- #:desired_capabilities => :firefox)
- )
-end
-
# By default, any exception happening in your Rails application will bubble up
# to Cucumber so that your scenario will fail. This is a different from how
# your application behaves in the production environment, where an error page will

0 comments on commit 295dccc

Please sign in to comment.
Something went wrong with that request. Please try again.