]> git.openstreetmap.org Git - rails.git/commitdiff
Split api relation show/full tests
authorAnton Khorev <tony29@yandex.ru>
Sat, 1 Feb 2025 12:13:09 +0000 (15:13 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 5 Feb 2025 17:22:16 +0000 (20:22 +0300)
test/controllers/api/relations_controller_test.rb

index cde794852d327de1b90c0741ca87a0fb39b8d77a..040062153013d2167ce8f1296a11787df9f5d0d7 100644 (file)
@@ -122,29 +122,33 @@ module Api
     # Test showing relations.
     # -------------------------------------
 
-    def test_show
-      # check that a visible relation is returned properly
-      get api_relation_path(create(:relation))
-      assert_response :success
+    def test_show_not_found
+      get api_relation_path(0)
+      assert_response :not_found
+    end
 
-      # check that an invisible relation is not returned
+    def test_show_deleted
       get api_relation_path(create(:relation, :deleted))
       assert_response :gone
+    end
 
-      # check chat a non-existent relation is not returned
-      get api_relation_path(0)
-      assert_response :not_found
+    def test_show
+      get api_relation_path(create(:relation))
+      assert_response :success
     end
 
-    def test_full
-      # check the "full" mode
-      get relation_full_path(:id => 999999)
+    def test_full_not_found
+      get relation_full_path(999999)
       assert_response :not_found
+    end
 
-      get relation_full_path(:id => create(:relation, :deleted).id)
+    def test_full_deleted
+      get relation_full_path(create(:relation, :deleted))
       assert_response :gone
+    end
 
-      get relation_full_path(:id => create(:relation).id)
+    def test_full_empty
+      get relation_full_path(create(:relation))
       assert_response :success
       # FIXME: check whether this contains the stuff we want!
     end