- # check moderator can still see the unredacted data, without passing
- # the appropriate flag
- get api_old_way_path(way_v1.way_id, way_v1.version), :headers => auth_header
- assert_response :success, "After unredaction, node should not be gone for moderator."
-
- # and when accessed via history
- get api_way_history_path(way), :headers => auth_header
- assert_response :success, "Unredaction shouldn't have stopped history working."
- assert_select "osm way[id='#{way_v1.way_id}'][version='#{way_v1.version}']", 1,
- "way #{way_v1.way_id} version #{way_v1.version} should still be present in the history for moderators."
-
- auth_header = bearer_authorization_header
-
- # check normal user can now see the unredacted data
- get api_old_way_path(way_v1.way_id, way_v1.version), :headers => auth_header
- assert_response :success, "After redaction, node should not be gone for moderator, when flag passed."
-
- # and when accessed via history
- get api_way_history_path(way), :headers => auth_header
- assert_response :success, "Redaction shouldn't have stopped history working."
- assert_select "osm way[id='#{way_v1.way_id}'][version='#{way_v1.version}']", 1,
- "way #{way_v1.way_id} version #{way_v1.version} should still be present in the history for normal users."