|
| 1 | +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. |
| 2 | +# It is recommended to regenerate this file in the future when you upgrade to a |
| 3 | +# newer version of cucumber-rails. Consider adding your own code to a new file |
| 4 | +# instead of editing this one. Cucumber will automatically load all features/**/*.rb |
| 5 | +# files. |
| 6 | + |
| 7 | +require 'cucumber/rails' |
| 8 | + |
| 9 | +# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In |
| 10 | +# order to ease the transition to Capybara we set the default here. If you'd |
| 11 | +# prefer to use XPath just remove this line and adjust any selectors in your |
| 12 | +# steps to use the XPath syntax. |
| 13 | +Capybara.default_selector = :css |
| 14 | + |
| 15 | +# By default, any exception happening in your Rails application will bubble up |
| 16 | +# to Cucumber so that your scenario will fail. This is a different from how |
| 17 | +# your application behaves in the production environment, where an error page will |
| 18 | +# be rendered instead. |
| 19 | +# |
| 20 | +# Sometimes we want to override this default behaviour and allow Rails to rescue |
| 21 | +# exceptions and display an error page (just like when the app is running in production). |
| 22 | +# Typical scenarios where you want to do this is when you test your error pages. |
| 23 | +# There are two ways to allow Rails to rescue exceptions: |
| 24 | +# |
| 25 | +# 1) Tag your scenario (or feature) with @allow-rescue |
| 26 | +# |
| 27 | +# 2) Set the value below to true. Beware that doing this globally is not |
| 28 | +# recommended as it will mask a lot of errors for you! |
| 29 | +# |
| 30 | +ActionController::Base.allow_rescue = false |
| 31 | + |
| 32 | +# Remove/comment out the lines below if your app doesn't have a database. |
| 33 | +# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. |
| 34 | +begin |
| 35 | + DatabaseCleaner.strategy = :transaction |
| 36 | +rescue NameError |
| 37 | + raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." |
| 38 | +end |
| 39 | + |
| 40 | +# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios. |
| 41 | +# See the DatabaseCleaner documentation for details. Example: |
| 42 | +# |
| 43 | +# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do |
| 44 | +# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]} |
| 45 | +# end |
| 46 | +# |
| 47 | +# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do |
| 48 | +# DatabaseCleaner.strategy = :transaction |
| 49 | +# end |
| 50 | +# |
0 commit comments