test: ajout test méthode update
This commit is contained in:
parent
eb92b35d19
commit
3575af41d3
5 changed files with 16 additions and 27 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue