mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Test serialized relationship data
This commit is contained in:
committed by
Maikel Linke
parent
46f9d3ef81
commit
028d02ccca
@@ -108,6 +108,20 @@ describe "Customers", type: :request do
|
||||
expect(json_error_detail).to eq "The resource you were looking for could not be found."
|
||||
end
|
||||
end
|
||||
|
||||
describe "related records" do
|
||||
it "serializes the enterprise relationship" do
|
||||
expected_enterprise_data = {
|
||||
"data" => {
|
||||
"id" => customer1.enterprise_id.to_s,
|
||||
"type" => "enterprise"
|
||||
}
|
||||
}
|
||||
|
||||
get "/api/v1/customers/#{customer1.id}"
|
||||
expect(json_response[:data][:relationships][:enterprise]).to eq(expected_enterprise_data)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
put "Update customer" do
|
||||
|
||||
Reference in New Issue
Block a user