Skip to content

Commit

Permalink
[Product Reviews API] - minor changes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstoicareea committed Oct 9, 2017
1 parent de75e27 commit ca4a90a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/Controller/ProductReviewApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function it_does_not_allows_accept_product_review_if_it_has_not_new_statu
$product = $productReviewsData['product1'];

/** @var ReviewInterface $productReview */
$productReview = $productReviewsData['productReview2'];
$productReview = $productReviewsData['productReview3'];

$this->client->request('POST', $this->getReviewUrl($product, $productReview) . '/accept', [], [], static::$authorizedHeaderWithAccept);
$response = $this->client->getResponse();
Expand Down
5 changes: 3 additions & 2 deletions tests/DataFixtures/ORM/resources/product_reviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ Sylius\Component\Core\Model\ProductReview:
rating: 4
comment: "mug_review_best_comment"
author: "@customer_example1"
status: "new"
reviewSubject: "@product1"
productReview2:
title: mug_review_good
rating: 3
comment: "mug_review_good_comment"
author: "@customer_example1"
status: "rejected"
status: "new"
reviewSubject: "@product1"
productReview3:
title: mug_review_bad
rating: 1
comment: "mug_review_bad_comment"
author: "@customer_example1"
status: "accepted"
status: "rejected"
reviewSubject: "@product1"
6 changes: 3 additions & 3 deletions tests/Responses/Expected/product_review/accept_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
}
},
"status": "rejected",
"status": "new",
"createdAt": @string@,
"updatedAt": @string@
},
Expand All @@ -71,12 +71,12 @@
}
}
},
"status": "accepted",
"status": "rejected",
"createdAt": @string@,
"updatedAt": @string@
}
},
"averageRating": 2.5,
"averageRating": 4,
"images": [],
"_links": {
"self": {
Expand Down
4 changes: 2 additions & 2 deletions tests/Responses/Expected/product_review/create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
}
},
"status": "rejected",
"status": "new",
"createdAt": @string@,
"updatedAt": @string@
},
Expand All @@ -91,7 +91,7 @@
}
}
},
"status": "accepted",
"status": "rejected",
"createdAt": @string@,
"updatedAt": @string@
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Responses/Expected/product_review/reject_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
}
},
"status": "rejected",
"status": "new",
"createdAt": @string@,
"updatedAt": @string@
},
Expand All @@ -71,7 +71,7 @@
}
}
},
"status": "accepted",
"status": "rejected",
"createdAt": @string@,
"updatedAt": @string@
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Responses/Expected/product_review/show_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
}
},
"status": "rejected",
"status": "new",
"createdAt": @string@,
"updatedAt": @string@
},
Expand All @@ -71,7 +71,7 @@
}
}
},
"status": "accepted",
"status": "rejected",
"createdAt": @string@,
"updatedAt": @string@
}
Expand Down

0 comments on commit ca4a90a

Please sign in to comment.