OSDN Git Service

fb8d32b29682e971d18c50468eeaded863a4d3c7
[pettanr/pettanr.git] / spec / spec_helper.rb
1 # This file is copied to spec/ when you run 'rails generate rspec:install'
2 ENV["RAILS_ENV"] ||= 'test'
3 require File.expand_path("../../config/environment", __FILE__)
4 require 'rspec/rails'
5 require File.dirname(__FILE__) + '/support/controller_macros'
6
7 # Requires supporting ruby files with custom matchers and macros, etc,
8 # in spec/support/ and its subdirectories.
9 Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
10 Dir.glob(File.dirname(__FILE__) + '/factories/*.rb').each {|f| require f }
11
12 RSpec.configure do |config|
13   config.deprecation_stream = File.open(File.dirname(__FILE__) + '/deprecations.txt', 'w')
14   # == Mock Framework
15   #
16   # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
17   #
18   # config.mock_with :mocha
19   # config.mock_with :flexmock
20   # config.mock_with :rr
21   config.mock_with :rspec
22
23   # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
24   config.fixture_path = "#{::Rails.root}/spec/fixtures"
25
26   # If you're not using ActiveRecord, or you'd prefer not to run each of your
27   # examples within a transaction, remove the following line or assign false
28   # instead of true.
29   config.use_transactional_fixtures = true
30
31   # If true, the base class of anonymous controllers will be inferred
32   # automatically. This will be the default behavior in future versions of
33   # rspec-rails.
34   config.infer_base_class_for_anonymous_controllers = false
35   config.include Devise::TestHelpers, :type => :controller
36 #  config.extend ControllerMacros, :type => :controller
37   config.infer_spec_type_from_file_location!
38   config.raise_errors_for_deprecations!
39   
40   config.include ControllerMacros
41 end