diff options
| author | Teddy Wing | 2017-11-29 18:29:18 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-11-29 18:29:18 +0100 |
| commit | 5fa02104cacdd2fcf6fa5c1ce6477eada0a7e9ef (patch) | |
| tree | c52a07b725146b46fa222d9ff7fb4ac30766f6c9 | |
| parent | 22896b02846617d6b9dd517f095ea1be676e88ba (diff) | |
| download | chouette-core-5fa02104cacdd2fcf6fa5c1ce6477eada0a7e9ef.tar.bz2 | |
spec/support/referential: Rename `:js` filter to `:truncation`
This `before` hook allows tests to use the "truncation" database cleanup
strategy. It doesn't do anything explicitly JavaScript-related. Rather,
it was named JS because it was intended to be used for feature tests
with JavaScript. However, now that I need to use it for a couple tests
in `spec/models/referential_spec.rb`, the `:js` name doesn't make sense.
Rename the filter to something that says what it does, not how it should
be used.
Refs #5024
| -rw-r--r-- | spec/features/lines_spec.rb | 2 | ||||
| -rw-r--r-- | spec/features/networks_spec.rb | 2 | ||||
| -rw-r--r-- | spec/features/users/user_delete_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/referential_spec.rb | 3 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 4 | ||||
| -rw-r--r-- | spec/support/referential.rb | 2 |
6 files changed, 7 insertions, 8 deletions
diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb index 2a442bd2f..620d411ff 100644 --- a/spec/features/lines_spec.rb +++ b/spec/features/lines_spec.rb @@ -69,7 +69,7 @@ describe "Lines", type: :feature do # end # Fixme #1780 - # describe "new with group of line", :js => true do + # describe "new with group of line", :truncation => true do # it "creates line and return to show" do # visit new_line_referential_line_path(line_referential) # fill_in "line_name", :with => "Line 1" diff --git a/spec/features/networks_spec.rb b/spec/features/networks_spec.rb index 75070e7fa..4fc4fc043 100644 --- a/spec/features/networks_spec.rb +++ b/spec/features/networks_spec.rb @@ -74,7 +74,7 @@ describe "Networks", :type => :feature do # end # end - # describe "delete", :js => true do + # describe "delete", :truncation => true do # it "delete network and return to the list" do # subject.stub(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) # visit line_referential_network_path(line_referential, subject) diff --git a/spec/features/users/user_delete_spec.rb b/spec/features/users/user_delete_spec.rb index 48f4e35d1..8b2ffcbe5 100644 --- a/spec/features/users/user_delete_spec.rb +++ b/spec/features/users/user_delete_spec.rb @@ -7,7 +7,7 @@ Warden.test_mode! # As a user # I want to delete my user profile # So I can close my account -feature 'User delete', :devise, :js do +feature 'User delete', :devise, :truncation do after(:each) do Warden.test_reset! diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index 5a882b06e..c064987c3 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -160,8 +160,7 @@ describe Referential, :type => :model do end end - # TODO: Rename js: true to no transaction something - it "works asynchronously", js: true do + it "works asynchronously", truncation: true do begin workbench = create(:workbench) referential_1 = build( diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6b37b9fa8..c8da5ad5c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -64,8 +64,8 @@ RSpec.configure do |config| # :meta tests can be run seperately in case of doubt about the tests themselves # they serve mainly as an explanataion of complicated tests (as e.g. PG information_schema introspection) config.filter_run_excluding :meta => true - config.filter_run_excluding :js => true - config.filter_run :wip => true + config.filter_run_excluding :truncation => true + config.filter_run :wip => true config.run_all_when_everything_filtered = true config.include TokenInputHelper, :type => :feature diff --git a/spec/support/referential.rb b/spec/support/referential.rb index b615491da..c0ae35779 100644 --- a/spec/support/referential.rb +++ b/spec/support/referential.rb @@ -78,7 +78,7 @@ RSpec.configure do |config| first_referential.switch end - config.before(:each, :js => true) do + config.before(:each, truncation: true) do DatabaseCleaner.strategy = :truncation, { except: %w[spatial_ref_sys] } end |
