1
0

spec_helper.rb 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # This file is copied to spec/ when you run 'rails generate rspec:install'
  2. ENV["RAILS_ENV"] ||= 'test'
  3. if ENV['COVERAGE']
  4. require 'simplecov'
  5. SimpleCov.start 'rails'
  6. else
  7. require 'coveralls'
  8. Coveralls.wear!('rails')
  9. end
  10. require File.expand_path("../../config/environment", __FILE__)
  11. require 'rspec/rails'
  12. require 'rspec/autorun'
  13. require 'rr'
  14. require 'webmock/rspec'
  15. WebMock.disable_net_connect!
  16. # Requires supporting ruby files with custom matchers and macros, etc,
  17. # in spec/support/ and its subdirectories.
  18. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
  19. RSpec.configure do |config|
  20. config.mock_with :rr
  21. # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  22. config.fixture_path = "#{::Rails.root}/spec/fixtures"
  23. # If you're not using ActiveRecord, or you'd prefer not to run each of your
  24. # examples within a transaction, remove the following line or assign false
  25. # instead of true.
  26. config.use_transactional_fixtures = true
  27. # If true, the base class of anonymous controllers will be inferred
  28. # automatically. This will be the default behavior in future versions of
  29. # rspec-rails.
  30. config.infer_base_class_for_anonymous_controllers = false
  31. # Run specs in random order to surface order dependencies. If you find an
  32. # order dependency and want to debug it, you can fix the order by providing
  33. # the seed, which is printed after each run.
  34. # --seed 1234
  35. config.order = "random"
  36. config.global_fixtures = :all
  37. config.treat_symbols_as_metadata_keys_with_true_values = true
  38. config.include Devise::TestHelpers, :type => :controller
  39. config.include SpecHelpers
  40. config.include Delorean
  41. end