diff options
| author | Teddy Wing | 2018-04-30 17:08:49 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-04-30 17:08:49 +0200 |
| commit | 2fdcbb5a82c23bdaa7e23bd0b3108f404c1e44ea (patch) | |
| tree | 2559336779e57eb856a2c14a52da7a69378677a5 /spec | |
| parent | 6779a070b8d5d6d738539f84e4405a86337f7dfb (diff) | |
| download | chouette-core-2fdcbb5a82c23bdaa7e23bd0b3108f404c1e44ea.tar.bz2 | |
Workbenches#show: Don't allow pending referentials to be selected6858-workbenches-show--disallow-deletion-of-pending-referent
Disable the checkboxes next to pending referentials. This prevents them
from being deleted by the batch deletion operation.
In general it seems like we shouldn't be operating on pending
referentials, so if any new batch actions are added, it would make sense
to me for the checkboxes to stay disabled.
We want to disallow deletion of pending referentials because this can
put the data in an inconsistent state that requires manual intervention
to clean (I think).
Refs #6858
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/workbenches/workbenches_show_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/workbenches/workbenches_show_spec.rb b/spec/features/workbenches/workbenches_show_spec.rb index 441f829a1..427b526cf 100644 --- a/spec/features/workbenches/workbenches_show_spec.rb +++ b/spec/features/workbenches/workbenches_show_spec.rb @@ -64,6 +64,27 @@ RSpec.describe 'Workbenches', type: :feature do "Couldn't find `hidden_referential`: `#{hidden_referential.inspect}`" end + it "prevents pending referentials from being selected" do + line = create(:line, line_referential: line_ref) + metadata = create(:referential_metadata, lines: [line]) + pending_referential = create( + :workbench_referential, + workbench: workbench, + metadatas: [metadata], + organisation: @user.organisation, + ready: false + ) + + visit workbench_path(workbench) + + expect( + find("input[type='checkbox'][value='#{referential.id}']") + ).not_to be_disabled + expect( + find("input[type='checkbox'][value='#{pending_referential.id}']") + ).to be_disabled + end + context 'filtering' do let!(:another_organisation) { create :organisation } let(:another_line) { create :line, line_referential: line_ref } |
