- with_terms_agreed(true) do
- user = create(:user, :terms_agreed => nil)
- token = create(:access_token, :user => user, :allow_write_api => true)
- changeset = create(:changeset, :closed)
-
- # Hack together an oauth request - an alternative would be to sign the request properly
- @request.env["oauth.version"] = 1
- @request.env["oauth.strategies"] = [:token]
- @request.env["oauth.token"] = token
-
- assert_difference "ChangesetComment.count", 0 do
- post :create, :params => { :id => changeset.id, :text => "This is a comment" }
- end
- assert_response :forbidden
+ user = create(:user, :terms_agreed => nil)
+ token = create(:access_token, :user => user, :allow_write_api => true)
+ changeset = create(:changeset, :closed)