mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Test permissions combined with Ransack searches
This commit is contained in:
committed by
Maikel Linke
parent
76f14a03c6
commit
46f9d3ef81
@@ -43,6 +43,16 @@ describe "Customers", type: :request do
|
||||
expect(json_response_ids).to eq [customer3.id.to_s]
|
||||
end
|
||||
end
|
||||
|
||||
context "with ransack params searching for specific customers" do
|
||||
before { login_as enterprise2.owner }
|
||||
|
||||
it "does not show results the user doesn't have permissions to view" do
|
||||
get "/api/v1/customers", params: { q: { id_eq: customer2.id } }
|
||||
|
||||
expect(json_response_ids).to eq []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
post "Create customer" do
|
||||
|
||||
Reference in New Issue
Block a user