3 #uncomment the following line to use spork with the debugger
4 #require 'spork/ext/ruby-debug'
7 # Loading more in this block will cause your tests to run faster. However,
8 # if you change any configuration or code from libraries loaded here, you'll
9 # need to restart spork for it take effect.
10 # This file is copied to spec/ when you run 'rails generate rspec:install'
11 ENV["RAILS_ENV"] ||= 'test'
12 require File.expand_path("../../config/environment", __FILE__)
14 require File.dirname(__FILE__) + '/support/controller_macros'
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 Dir.glob(File.dirname(__FILE__) + '/factories/*.rb').each {|f| require f }
21 RSpec.configure do |config|
22 config.deprecation_stream = File.open(File.dirname(__FILE__) + '/deprecations.txt', 'w')
25 # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
27 # config.mock_with :mocha
28 # config.mock_with :flexmock
29 # config.mock_with :rr
30 config.mock_with :rspec
32 # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
33 config.fixture_path = "#{::Rails.root}/spec/fixtures"
35 # If you're not using ActiveRecord, or you'd prefer not to run each of your
36 # examples within a transaction, remove the following line or assign false
38 config.use_transactional_fixtures = true
40 # If true, the base class of anonymous controllers will be inferred
41 # automatically. This will be the default behavior in future versions of
43 config.infer_base_class_for_anonymous_controllers = false
44 config.include Devise::TestHelpers, :type => :controller
45 # config.extend ControllerMacros, :type => :controller
46 config.infer_spec_type_from_file_location!
47 config.raise_errors_for_deprecations!
49 config.include ControllerMacros
55 # This code will be run each time you run your specs.
59 # --- Instructions ---
60 # Sort the contents of this file into a Spork.prefork and a Spork.each_run
63 # The Spork.prefork block is run only once when the spork server is started.
64 # You typically want to place most of your (slow) initializer code in here, in
65 # particular, require'ing any 3rd-party gems that you don't normally modify
68 # The Spork.each_run block is run each time you run your specs. In case you
69 # need to load files that tend to change during development, require them here.
70 # With Rails, your application modules are loaded automatically, so sometimes
71 # this block can remain empty.
73 # Note: You can modify files loaded *from* the Spork.each_run block without
74 # restarting the spork server. However, this file itself will not be reloaded,
75 # so if you change any of the code inside the each_run block, you still need to
76 # restart the server. In general, if you have non-trivial code in this file,
77 # it's advisable to move it into a separate file so you can easily edit it
78 # without restarting spork. (For example, with RSpec, you could move
79 # non-trivial code into a file spec/support/my_helper.rb, making sure that the
80 # spec/support/* files are require'd from inside the each_run block.)
82 # Any code that is left outside the two blocks will be run during preforking
83 # *and* during each_run -- that's probably not what you want.
85 # These instructions should self-destruct in 10 seconds. If they don't, feel
86 # free to delete them.