Commit 7a89cef601dde68d5964f68bb6fe2e94d72fcf55

Authored by Dmitriy Zaporozhets
2 parents 4dcf2f1c 2838a993

Merge pull request #7092 from jvanbaarsen/tmp-fix-for-rspec

Temp fix for rspec so the specs are run again
Gemfile.lock
... ... @@ -89,7 +89,7 @@ GEM
89 89 d3_rails (3.1.10)
90 90 railties (>= 3.1.0)
91 91 daemons (1.1.9)
92   - database_cleaner (1.2.0)
  92 + database_cleaner (1.3.0)
93 93 debug_inspector (0.0.2)
94 94 default_value_for (3.0.0)
95 95 activerecord (>= 3.2.0, < 5.0)
... ...
spec/spec_helper.rb
... ... @@ -27,6 +27,8 @@ Dir[Rails.root.join(&quot;spec/support/**/*.rb&quot;)].each {|f| require f}
27 27 WebMock.disable_net_connect!(allow_localhost: true)
28 28  
29 29 RSpec.configure do |config|
  30 + config.use_transactional_fixtures = false
  31 + config.use_instantiated_fixtures = false
30 32 config.mock_with :rspec
31 33  
32 34 config.include LoginHelpers, type: :feature
... ... @@ -39,7 +41,6 @@ RSpec.configure do |config|
39 41 # If you're not using ActiveRecord, or you'd prefer not to run each of your
40 42 # examples within a transaction, remove the following line or assign false
41 43 # instead of true.
42   - config.use_transactional_fixtures = false
43 44  
44 45 config.before(:suite) do
45 46 TestEnv.init(observers: false, init_repos: true, repos: false)
... ...
spec/support/db_cleaner.rb
  1 +# RSpec.configure do |config|
  2 +
  3 +# config.around(:each) do |example|
  4 +# DatabaseCleaner.strategy = :transaction
  5 +# DatabaseCleaner.clean_with(:truncation)
  6 +# DatabaseCleaner.cleaning do
  7 +# example.run
  8 +# end
  9 +# end
  10 +
  11 +# config.around(:each, js: true) do |example|
  12 +# DatabaseCleaner.strategy = :truncation
  13 +# DatabaseCleaner.clean_with(:truncation)
  14 +# DatabaseCleaner.cleaning do
  15 +# example.run
  16 +# end
  17 +# end
  18 +# end
1 19 RSpec.configure do |config|
2   - config.around(:each) do
  20 + config.before(:suite) do
3 21 DatabaseCleaner.clean_with(:truncation)
4 22 end
5 23  
6   - config.around(:each) do
  24 + config.before(:each) do
7 25 DatabaseCleaner.strategy = :transaction
8 26 end
9 27  
10   - config.around(:each, js: true) do
  28 + config.before(:each, :js => true) do
11 29 DatabaseCleaner.strategy = :truncation
12 30 end
13 31  
... ...