test/integration/routes/routes_test.rb in jsonapi-resources-0.5.7 vs test/integration/routes/routes_test.rb in jsonapi-resources-0.5.8
- old
+ new
@@ -50,9 +50,20 @@
def test_routing_posts_links_tags_update_acts_as_set
assert_routing({path: '/posts/1/relationships/tags', method: :patch},
{controller: 'posts', action: 'update_relationship', post_id: '1', relationship: 'tags'})
end
+ def test_routing_uuid
+ assert_routing({path: '/pets/v1/cats/f1a4d5f2-e77a-4d0a-acbb-ee0b98b3f6b5', method: :get},
+ {action: 'show', controller: 'pets/v1/cats', id: 'f1a4d5f2-e77a-4d0a-acbb-ee0b98b3f6b5'})
+ end
+
+ # ToDo: refute this routing
+ # def test_routing_uuid_bad_format
+ # assert_routing({path: '/pets/v1/cats/f1a4d5f2-e77a-4d0a-acbb-ee0b9', method: :get},
+ # {action: 'show', controller: 'pets/v1/cats', id: 'f1a4d5f2-e77a-4d0a-acbb-ee0b98'})
+ # end
+
# Polymorphic
def test_routing_polymorphic_get_related_resource
assert_routing(
{
path: '/pictures/1/imageable',