spec_helper.rb 1.6 KB

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