aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features
diff options
context:
space:
mode:
authorLuc Donnet2018-01-16 10:05:31 +0100
committerGitHub2018-01-16 10:05:31 +0100
commitb1c55750bb43736c2cb6f9619bddc453cfadb1aa (patch)
tree455c246de077f7db95a3bd6549a979dbf57597d7 /spec/features
parent06b37dd16a136eee747103de2144a96cf1718adc (diff)
parent88b1e7c640d89d5bb435e4e415105b071ef0d457 (diff)
downloadchouette-core-b1c55750bb43736c2cb6f9619bddc453cfadb1aa.tar.bz2
Merge pull request #242 from af83/5140-workbenches-show--organisation-filter-should-show-orgs-
5140-workbenches-show--organisation-filter-should-show-orgs-in-workgroup--v2
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/workbenches/workbenches_show_spec.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/features/workbenches/workbenches_show_spec.rb b/spec/features/workbenches/workbenches_show_spec.rb
index f1151a67b..2b215bb03 100644
--- a/spec/features/workbenches/workbenches_show_spec.rb
+++ b/spec/features/workbenches/workbenches_show_spec.rb
@@ -26,7 +26,23 @@ RSpec.describe 'Workbenches', type: :feature do
let!(:another_organisation) { create :organisation }
let(:another_line) { create :line, line_referential: line_ref }
let(:another_ref_metadata) { create(:referential_metadata, lines: [another_line]) }
- let!(:other_referential) { create :workbench_referential, workbench: workbench, metadatas: [another_ref_metadata] }
+ let(:other_workbench) do
+ create(
+ :workbench,
+ line_referential: line_ref,
+ organisation: another_organisation,
+ workgroup: workbench.workgroup
+ )
+ end
+ let!(:other_referential) do
+ create(
+ :workbench_referential,
+ workbench: other_workbench,
+ metadatas: [another_ref_metadata],
+ organisation: other_workbench.organisation
+ )
+ end
+
before(:each) do
visit workbench_path(workbench)
@@ -64,6 +80,18 @@ RSpec.describe 'Workbenches', type: :feature do
click_button I18n.t('actions.filter')
expect(find(box)).to be_checked
end
+
+ it 'only lists organisations in the current workgroup' do
+ unaffiliated_workbench = workbench.dup
+ unaffiliated_workbench.update(organisation: create(:organisation))
+
+ expect(page).to have_selector(
+ "#q_organisation_name_eq_any_#{@user.organisation.name.parameterize.underscore}"
+ )
+ expect(page).to_not have_selector(
+ "#q_organisation_name_eq_any_#{unaffiliated_workbench.name.parameterize.underscore}"
+ )
+ end
end
context 'filter by status' do