changeset = create(:changeset, :closed)
assert_difference "ChangesetComment.count", 0 do
- signed_post changeset_comment_path(changeset), :params => { :text => "This is a comment" }, :oauth => { :token => token }
- post changeset_comment_path(:id => changeset), :params => { :text => "This is a comment" }, :headers => bearer_authorization_header(token.token)
++ post changeset_comment_path(changeset), :params => { :text => "This is a comment" }, :headers => bearer_authorization_header(token.token)
end
assert_response :forbidden
user.save!
assert_difference "ChangesetComment.count", 1 do
- signed_post changeset_comment_path(changeset), :params => { :text => "This is a comment" }, :oauth => { :token => token }
- post changeset_comment_path(:id => changeset), :params => { :text => "This is a comment" }, :headers => bearer_authorization_header(token.token)
++ post changeset_comment_path(changeset), :params => { :text => "This is a comment" }, :headers => bearer_authorization_header(token.token)
end
assert_response :success
end