Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + "/../spec_helper"
- require 'steak'
- require 'capybara'
- require 'capybara/rails'
- require 'capybara/dsl'
- require 'capybara/envjs'
- require 'database_cleaner'
- # Put your acceptance spec helpers inside /spec/acceptance/support
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
- Capybara.default_driver = :envjs
- # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
- # order to ease the transition to Capybara we set the default here. If you'd
- # prefer to use XPath just remove this line and adjust any selectors in your
- # steps to use the XPath syntax.
- Capybara.default_selector = :css
- # If you set this to false, any error raised from within your app will bubble
- # up to your step definition and out to cucumber unless you catch it somewhere
- # on the way. You can make Rails rescue errors and render error pages on a
- # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
- #
- # If you set this to true, Rails will rescue all errors and render error
- # pages, more or less in the same way your application would behave in the
- # default production environment. It's not recommended to do this for all
- # of your scenarios, as this makes it hard to discover errors in your application.
- ActionController::Base.allow_rescue = false
- DatabaseCleaner.strategy = :transaction
- Spec::Runner.configure do |config|
- config.include(Capybara)
- config.before(:suite) do
- DatabaseCleaner.clean_with(:truncation)
- end
- config.before(:each) do
- DatabaseCleaner.start
- User.remove_all_from_index!
- Job.remove_all_from_index!
- end
- config.after(:each) do
- DatabaseCleaner.clean
- User.remove_all_from_index!
- Job.remove_all_from_index!
- end
- end
Add Comment
Please, Sign In to add comment