- ##
- # test the redaction of an old version of a way, while not being
- # authorised.
- def test_redact_way_unauthorised
- way = create(:way, :with_history, :version => 4)
- way_v3 = way.old_ways.find_by(:version => 3)
-
- do_redact_way(way_v3, create(:redaction))
- assert_response :unauthorized, "should need to be authenticated to redact."
- end
-
- ##
- # test the redaction of an old version of a way, while being
- # authorised as a normal user.
- def test_redact_way_normal_user
- auth_header = bearer_authorization_header
- way = create(:way, :with_history, :version => 4)
- way_v3 = way.old_ways.find_by(:version => 3)
-
- do_redact_way(way_v3, create(:redaction), auth_header)
- assert_response :forbidden, "should need to be moderator to redact."
- end
-