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

env.rb 2.9KB

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