aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorVlatka Pavisic2017-01-30 14:28:53 +0100
committerVlatka Pavisic2017-01-30 14:29:07 +0100
commit8ce5d4f67210990e22a716b82a7d3fb634d80fa9 (patch)
tree7130fd33d5178d0c46e6a4b2d8487f118092b08e /spec
parentd8c77d0c4cfe27747c4f6000fb8b4ef46d5b4be0 (diff)
downloadchouette-core-8ce5d4f67210990e22a716b82a7d3fb634d80fa9.tar.bz2
Refs #2474 : Show all referentials in workbenches#show
Diffstat (limited to 'spec')
-rw-r--r--spec/features/workbenches_spec.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/features/workbenches_spec.rb b/spec/features/workbenches_spec.rb
index 1ff39e1be..262991353 100644
--- a/spec/features/workbenches_spec.rb
+++ b/spec/features/workbenches_spec.rb
@@ -3,15 +3,28 @@ require 'spec_helper'
describe 'Workbenches', type: :feature do
login_user
- let!(:workbench) { create :workbench }
- let!(:ready_referential) { create(:referential, workbench: workbench, ready: true) }
- let!(:unready_referential) { create(:referential, workbench: workbench) }
+ let!(:organisations) { Array.new(2) { create :organisation } }
+ let!(:referentials) { Array.new(2) { create :referential, ready: true } }
+ let!(:line_referential) { create :line_referential }
+ let!(:workbenches) { Array.new(2) { create :workbench, line_referential: line_referential } }
+ let!(:line) { create :line, line_referential: line_referential }
+ let!(:referential_metadatas) { Array.new(2) { |i| create :referential_metadata, lines: [line], referential: referentials[i] } }
+
+ let!(:ready_referential) { create(:referential, workbench: workbenches.first, ready: true) }
+ let!(:unready_referential) { create(:referential, workbench: workbenches.first) }
describe 'show' do
- it 'shows ready referentials belonging to that workbench' do
- visit workbench_path(workbench)
+ it 'shows ready referentials belonging to that workbench by default' do
+ visit workbench_path(workbenches.first)
expect(page).to have_content(ready_referential.name)
expect(page).not_to have_content(unready_referential.name)
end
+
+ it 'shows all ready referentials if that option is chosen' do
+ visit workbench_path(workbenches.first)
+ click_link I18n.t('referentials.show.show_all_referentials')
+ expect(page).to have_content(referentials.first.name)
+ expect(page).to have_content(referentials.last.name)
+ end
end
end