test: ajout test méthode update

This commit is contained in:
Lou 2021-08-09 20:58:23 +02:00
commit 3575af41d3
5 changed files with 16 additions and 27 deletions

View file

@ -73,21 +73,13 @@ class Api::V1::MembershipsControllerTest < ActionDispatch::IntegrationTest
assert_response :forbidden
end
# test "should forbid update read_only attributes - team_id" do
# patch api_v1_membership_url(@membership),
# headers: { Authorization: JsonWebToken.encode(user_id: @user.id) },
# params: { membership: { team_id: @team2.id } },
# as: :json
# assert_response :unprocessable_entity
# end
# test "should forbid update read_only attributes - member_id" do
# patch api_v1_membership_url(@membership),
# headers: { Authorization: JsonWebToken.encode(user_id: @user.id) },
# params: { membership: { member_id: @user2.id } },
# as: :json
# assert_response :unprocessable_entity
# end
test "should forbid update read_only attributes - team_id" do
patch api_v1_membership_url(@membership),
headers: { Authorization: JsonWebToken.encode(user_id: @user.id) },
params: { membership: { team_id: @team2.id, member_id: @user2.id } },
as: :json
assert_response :unprocessable_entity
end
# DESTROY
test "should destroy membership" do