Skip to content

Commit b00730f

Browse files
committed
Test more explicitly what is showing in the filtered response
1 parent bbb8c9b commit b00730f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spec/requests/requests_requests_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@
4343
end
4444

4545
context "when there is a filter applied" do
46-
it "shows print unfulfilled picklists button with correct quantity when filtered" do
46+
it "shows only filtered requests, print unfulfilled picklists button with correct quantity" do
4747
Request.delete_all
4848

49-
create(:request, :pending)
50-
create(:request, :started)
49+
started_request = create(:request, :started, comments: "Started request - should appear")
50+
pending_request = create(:request, :pending, comments: "Pending request - should not appear")
5151

5252
get requests_path({ filters: { by_status: :started} })
5353

5454
expect(response.body).to include('Print Unfulfilled Picklists (1)')
55+
expect(response.body).to include(started_request.comments)
56+
expect(response.body).not_to include(pending_request.comments)
5557
end
5658
end
5759
end

0 commit comments

Comments
 (0)