Sha256: ed652fc5e3ab0efaa310fa937345c456d6439ccf7217d90d38bf5fc8a3ee95e3
Contents?: true
Size: 477 Bytes
Versions: 6
Compression:
Stored size: 477 Bytes
Contents
shared_examples "modifying product actions are restricted" do it "cannot create a new product if not an admin" do api_post :create, product: { name: "Brand new product!" } assert_unauthorized! end it "cannot update a product" do api_put :update, id: product.to_param, product: { name: "I hacked your store!" } assert_unauthorized! end it "cannot delete a product" do api_delete :destroy, id: product.to_param assert_unauthorized! end end
Version data entries
6 entries across 6 versions & 1 rubygems