Skip to content

Commit e2d6eab

Browse files
Add specs for filter addition
1 parent 3d844fa commit e2d6eab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/system/request_system_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:item1) { create(:item, name: "Good item") }
66
let(:item2) { create(:item, name: "Crap item") }
77
let(:partner1) { create(:partner, name: "This Guy", email: "[email protected]") }
8-
let(:partner2) { create(:partner, name: "That Guy", email: "[email protected]") }
8+
let(:partner2) { create(:partner, name: "That Guy", email: "[email protected]", default_storage_location_id: storage_location.id) }
99
let!(:storage_location) { create(:storage_location, organization: organization) }
1010

1111
before do
@@ -93,6 +93,16 @@
9393
end
9494
end
9595

96+
context "when filtering by default storage location" do
97+
it "constrains the list" do
98+
visit subject
99+
expect(page).to have_css("table tbody tr", count: 5)
100+
select(storage_location.name, from: "filters[by_default_storage_location]")
101+
click_on 'Filter'
102+
expect(page).to have_css("table tbody tr", count: 1)
103+
end
104+
end
105+
96106
context "when exporting as CSV" do
97107
it "respects the applied filters" do
98108
visit subject

0 commit comments

Comments
 (0)