Skip to content

Commit

Permalink
GH #13: separate acceptance from unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Karnowski and Lake Denman committed Apr 5, 2012
1 parent 010b277 commit fcb0171
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion spec/acceptance_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

describe 'App is alive', :js => true do
describe 'App is alive', :js => true, :acceptance => true do
it 'verifies coffeescript served up as js' do
visit '/assets/relevance_rails.js'
page.should have_content "console.log('Hello from Relevance, Inc!');"
Expand Down
22 changes: 14 additions & 8 deletions spec/spec_helper.rb
Expand Up @@ -25,18 +25,24 @@ def should_abort_with(msg)
end

RSpec.configure do |config|
config.include Capybara::DSL
config.include TestHelpers
config.filter_run :focused => true
config.filter_run_excluding :disabled => true
if ENV['ACCEPTANCE']
config.include Capybara::DSL
config.filter_run :acceptance => true
config.run_all_when_everything_filtered = false
else
config.include TestHelpers
config.filter_run :focused => true
config.filter_run_excluding :acceptance => true
config.filter_run_excluding :disabled => true
config.run_all_when_everything_filtered = true
end

config.alias_example_to :fit, :focused => true
config.alias_example_to :xit, :disabled => true
config.alias_example_to :they
config.run_all_when_everything_filtered = true
end

Capybara.current_driver = :selenium
Capybara.run_server = false
# vagrant or ec2 instance is up and running ...
Capybara.app_host = 'http://localhost:3000'
# Capybara.app_host = 'http://184.72.185.16'
#Capybara.app_host = 'http://' + (ENV["ACCEPTANCE_HOST"] || 'localhost:3000')
Capybara.app_host = ENV["ACCEPTANCE_HOST"] || 'http://localhost:3000'

0 comments on commit fcb0171

Please sign in to comment.