- def test_redact_relation_by_moderator_with_write_redactions_scope
- auth_header = create_bearer_auth_header(create(:moderator_user), %w[write_redactions])
- do_redact_redactable_relation(auth_header)
- assert_response :success, "should be OK to redact old version as moderator with write_redactions scope."
+ def test_show
+ relation = create(:relation, :with_history, :version => 2)
+ create(:old_relation_tag, :old_relation => relation.old_relations[0], :k => "k1", :v => "v1")
+ create(:old_relation_tag, :old_relation => relation.old_relations[1], :k => "k2", :v => "v2")
+
+ get api_relation_version_path(relation, 1)
+
+ assert_response :success
+ assert_dom "osm:root", 1 do
+ assert_dom "> relation", 1 do
+ assert_dom "> @id", relation.id.to_s
+ assert_dom "> @version", "1"
+ assert_dom "> tag", 1 do
+ assert_dom "> @k", "k1"
+ assert_dom "> @v", "v1"
+ end
+ end
+ end
+
+ get api_relation_version_path(relation, 2)
+
+ assert_response :success
+ assert_dom "osm:root", 1 do
+ assert_dom "> relation", 1 do
+ assert_dom "> @id", relation.id.to_s
+ assert_dom "> @version", "2"
+ assert_dom "> tag", 1 do
+ assert_dom "> @k", "k2"
+ assert_dom "> @v", "v2"
+ end
+ end
+ end