A website template with lots of features, built with ruby on rails.

env.rb 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. require 'cucumber/rails'
  7. # require "#{Rails.root}/features/support/cucumber_external_resque_worker"
  8. # CucumberExternalResqueWorker.start
  9. # Capybara defaults to CSS3 selectors rather than XPath.
  10. # If you'd prefer to use XPath, just uncomment this line and adjust any
  11. # selectors in your step definitions to use the XPath syntax.
  12. # Capybara.default_selector = :xpath
  13. # By default, any exception happening in your Rails application will bubble up
  14. # to Cucumber so that your scenario will fail. This is a different from how
  15. # your application behaves in the production environment, where an error page will
  16. # be rendered instead.
  17. #
  18. # Sometimes we want to override this default behaviour and allow Rails to rescue
  19. # exceptions and display an error page (just like when the app is running in production).
  20. # Typical scenarios where you want to do this is when you test your error pages.
  21. # There are two ways to allow Rails to rescue exceptions:
  22. #
  23. # 1) Tag your scenario (or feature) with @allow-rescue
  24. #
  25. # 2) Set the value below to true. Beware that doing this globally is not
  26. # recommended as it will mask a lot of errors for you!
  27. #
  28. ActionController::Base.allow_rescue = false
  29. # Remove/comment out the lines below if your app doesn't have a database.
  30. # For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
  31. begin
  32. DatabaseCleaner.strategy = :truncation
  33. rescue NameError
  34. raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
  35. end
  36. # You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
  37. # See the DatabaseCleaner documentation for details. Example:
  38. #
  39. # Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
  40. # # { :except => [:widgets] } may not do what you expect here
  41. # # as Cucumber::Rails::Database.javascript_strategy overrides
  42. # # this setting.
  43. # DatabaseCleaner.strategy = :truncation
  44. # end
  45. #
  46. # Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
  47. # DatabaseCleaner.strategy = :transaction
  48. # end
  49. #
  50. # Possible values are :truncation and :transaction
  51. # The :transaction strategy is faster, but might give you threading problems.
  52. # See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
  53. Cucumber::Rails::Database.javascript_strategy = :truncation
  54. require "#{Rails.root}/spec/factories.rb"
  55. # Make sure this require is after you require cucumber/rails/world.
  56. require 'email_spec' # add this line if you use spork
  57. require 'email_spec/cucumber'
  58. require "#{Rails.root}/spec/spec_helper"
  59. ActionMailer::Base.delivery_method = :test
  60. ActionMailer::Base.perform_deliveries = true
  61. ActionMailer::Base.deliveries.clear