Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (35 sloc) 1.543 kb
bbcebcd @dchelimsky Use Rails config to determine whether or not we're using AR
dchelimsky authored
1 module RSpec
2 module Rails
08ed00a @jasonmk Check to see if the module we're actually working with is loaded (in cas...
jasonmk authored
3 if defined?(ActiveRecord::TestFixtures)
83f2a44 @dchelimsky don't define AR extensions unless AR is defined
dchelimsky authored
4 module FixtureSupport
5 extend ActiveSupport::Concern
b39e5fd @dchelimsky Move FixtureExampleGroupBehaviour to RSpec::Rails::FixtureSupport
dchelimsky authored
6
83f2a44 @dchelimsky don't define AR extensions unless AR is defined
dchelimsky authored
7 include RSpec::Rails::SetupAndTeardownAdapter
8 include RSpec::Rails::TestUnitAssertionAdapter
bbcebcd @dchelimsky Use Rails config to determine whether or not we're using AR
dchelimsky authored
9 include ActiveRecord::TestFixtures
b39e5fd @dchelimsky Move FixtureExampleGroupBehaviour to RSpec::Rails::FixtureSupport
dchelimsky authored
10
83f2a44 @dchelimsky don't define AR extensions unless AR is defined
dchelimsky authored
11 included do
9ad14ae @dchelimsky Fix bug caused by fixture_file_upload reading from ActionController::Tes...
dchelimsky authored
12 # TODO (DC 2011-06-25) this is necessary because fixture_file_upload
13 # accesses fixture_path directly on ActiveSupport::TestCase. This is
14 # fixed in rails by https://github.com/rails/rails/pull/1861, which
15 # should be part of the 3.1 release, at which point we can include
16 # these lines for rails < 3.1.
17 ActiveSupport::TestCase.class_eval do
18 include ActiveRecord::TestFixtures
19 self.fixture_path = RSpec.configuration.fixture_path
20 end
21 # /TODO
22
d59ff2b @lailsonbm Removed conditional around ActiveRecord::TestFixtures inclusion.
lailsonbm authored
23 self.fixture_path = RSpec.configuration.fixture_path
24 self.use_transactional_fixtures = RSpec.configuration.use_transactional_fixtures
25 self.use_instantiated_fixtures = RSpec.configuration.use_instantiated_fixtures
26 fixtures RSpec.configuration.global_fixtures if RSpec.configuration.global_fixtures
96a29c4 @dchelimsky cleanup whitespace
dchelimsky authored
27 end
b39e5fd @dchelimsky Move FixtureExampleGroupBehaviour to RSpec::Rails::FixtureSupport
dchelimsky authored
28 end
29
bbcebcd @dchelimsky Use Rails config to determine whether or not we're using AR
dchelimsky authored
30 RSpec.configure do |c|
31 c.include RSpec::Rails::FixtureSupport
48d4cd3 @dchelimsky align config extensions with changes to rspec-core planned for 2.8
dchelimsky authored
32 c.add_setting :use_transactional_fixtures, :alias_with => :use_transactional_examples
bbcebcd @dchelimsky Use Rails config to determine whether or not we're using AR
dchelimsky authored
33 c.add_setting :use_instantiated_fixtures
34 c.add_setting :global_fixtures
35 c.add_setting :fixture_path
36 end
37 end
83f2a44 @dchelimsky don't define AR extensions unless AR is defined
dchelimsky authored
38 end
b39e5fd @dchelimsky Move FixtureExampleGroupBehaviour to RSpec::Rails::FixtureSupport
dchelimsky authored
39 end
bbcebcd @dchelimsky Use Rails config to determine whether or not we're using AR
dchelimsky authored
40
Something went wrong with that request. Please try again.