Commit 7a89cef601dde68d5964f68bb6fe2e94d72fcf55
Exists in
spb-stable
and in
2 other branches
Merge pull request #7092 from jvanbaarsen/tmp-fix-for-rspec
Temp fix for rspec so the specs are run again
Showing
3 changed files
with
24 additions
and
5 deletions
Show diff stats
Gemfile.lock
@@ -89,7 +89,7 @@ GEM | @@ -89,7 +89,7 @@ GEM | ||
89 | d3_rails (3.1.10) | 89 | d3_rails (3.1.10) |
90 | railties (>= 3.1.0) | 90 | railties (>= 3.1.0) |
91 | daemons (1.1.9) | 91 | daemons (1.1.9) |
92 | - database_cleaner (1.2.0) | 92 | + database_cleaner (1.3.0) |
93 | debug_inspector (0.0.2) | 93 | debug_inspector (0.0.2) |
94 | default_value_for (3.0.0) | 94 | default_value_for (3.0.0) |
95 | activerecord (>= 3.2.0, < 5.0) | 95 | activerecord (>= 3.2.0, < 5.0) |
spec/spec_helper.rb
@@ -27,6 +27,8 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | @@ -27,6 +27,8 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | ||
27 | WebMock.disable_net_connect!(allow_localhost: true) | 27 | WebMock.disable_net_connect!(allow_localhost: true) |
28 | 28 | ||
29 | RSpec.configure do |config| | 29 | RSpec.configure do |config| |
30 | + config.use_transactional_fixtures = false | ||
31 | + config.use_instantiated_fixtures = false | ||
30 | config.mock_with :rspec | 32 | config.mock_with :rspec |
31 | 33 | ||
32 | config.include LoginHelpers, type: :feature | 34 | config.include LoginHelpers, type: :feature |
@@ -39,7 +41,6 @@ RSpec.configure do |config| | @@ -39,7 +41,6 @@ RSpec.configure do |config| | ||
39 | # If you're not using ActiveRecord, or you'd prefer not to run each of your | 41 | # If you're not using ActiveRecord, or you'd prefer not to run each of your |
40 | # examples within a transaction, remove the following line or assign false | 42 | # examples within a transaction, remove the following line or assign false |
41 | # instead of true. | 43 | # instead of true. |
42 | - config.use_transactional_fixtures = false | ||
43 | 44 | ||
44 | config.before(:suite) do | 45 | config.before(:suite) do |
45 | TestEnv.init(observers: false, init_repos: true, repos: false) | 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 | RSpec.configure do |config| | 19 | RSpec.configure do |config| |
2 | - config.around(:each) do | 20 | + config.before(:suite) do |
3 | DatabaseCleaner.clean_with(:truncation) | 21 | DatabaseCleaner.clean_with(:truncation) |
4 | end | 22 | end |
5 | 23 | ||
6 | - config.around(:each) do | 24 | + config.before(:each) do |
7 | DatabaseCleaner.strategy = :transaction | 25 | DatabaseCleaner.strategy = :transaction |
8 | end | 26 | end |
9 | 27 | ||
10 | - config.around(:each, js: true) do | 28 | + config.before(:each, :js => true) do |
11 | DatabaseCleaner.strategy = :truncation | 29 | DatabaseCleaner.strategy = :truncation |
12 | end | 30 | end |
13 | 31 |