diff options
| author | Zog | 2018-05-04 09:03:12 +0200 |
|---|---|---|
| committer | Zog | 2018-05-04 09:03:12 +0200 |
| commit | fc427e5807f62416fdc93a8c6dda006137f06537 (patch) | |
| tree | 98bc61f38590596bd743efa24ff8db70c4395eeb /spec | |
| parent | 7839c6cc052156383d17be27df864f92f40f273c (diff) | |
| download | chouette-core-fc427e5807f62416fdc93a8c6dda006137f06537.tar.bz2 | |
Refs #6920; Fix specs6920-activate-newly-created-referentials
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/controllers/statuses_controller_spec.rb | 2 | ||||
| -rw-r--r-- | spec/factories/referentials.rb | 7 | ||||
| -rw-r--r-- | spec/features/workbenches/workbenches_show_spec.rb | 1 | ||||
| -rw-r--r-- | spec/models/import/netex_import_spec.rb | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb index 8a6db8e28..65b338888 100644 --- a/spec/controllers/statuses_controller_spec.rb +++ b/spec/controllers/statuses_controller_spec.rb @@ -31,7 +31,7 @@ RSpec.describe StatusesController, :type => :controller do context "with a blocked object" do before do - create :referential, created_at: 5.hours.ago, ready: false + r = create :referential, created_at: 5.hours.ago, status: :pending create :import create :compliance_check_set request diff --git a/spec/factories/referentials.rb b/spec/factories/referentials.rb index 0276a47be..bbaa7c313 100644 --- a/spec/factories/referentials.rb +++ b/spec/factories/referentials.rb @@ -9,6 +9,13 @@ FactoryGirl.define do time_zone "Europe/Paris" ready { true } objectid_format "stif_netex" + transient do + status :active + end + + after(:create) do |referential, evaluator| + referential.send "#{evaluator.status}!" + end factory :workbench_referential do association :workbench diff --git a/spec/features/workbenches/workbenches_show_spec.rb b/spec/features/workbenches/workbenches_show_spec.rb index 427b526cf..e892f00e7 100644 --- a/spec/features/workbenches/workbenches_show_spec.rb +++ b/spec/features/workbenches/workbenches_show_spec.rb @@ -74,6 +74,7 @@ RSpec.describe 'Workbenches', type: :feature do organisation: @user.organisation, ready: false ) + pending_referential.pending! visit workbench_path(workbench) diff --git a/spec/models/import/netex_import_spec.rb b/spec/models/import/netex_import_spec.rb index 6424fbfe1..bc3b9f7ed 100644 --- a/spec/models/import/netex_import_spec.rb +++ b/spec/models/import/netex_import_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Import::Netex, type: [:model, :with_commit] do describe "#destroy" do it "must destroy its associated Referential if ready: false" do workbench_import = create(:workbench_import) - referential_ready_false = create(:referential, ready: false) + referential_ready_false = create(:referential, status: :pending) referential_ready_true = create(:referential, ready: true) create( :netex_import, |
