@@ -7,15 +7,15 @@ class LinksTest < ActiveSupport::TestCase
77 LinkAuthor = Class . new ( ::Model )
88 class LinkAuthorSerializer < ActiveModel ::Serializer
99 link :self do
10- href "//example.com/link_author/#{ object . id } "
10+ href "http: //example.com/link_author/#{ object . id } "
1111 meta stuff : 'value'
1212 end
1313 link ( :author ) { link_author_url ( object . id ) }
14- link ( :link_authors ) { link_authors_url }
15- link :other , '//example.com/resource'
14+ link ( :link_authors ) { url_for ( controller : 'link_authors' , action : 'index' , only_path : false ) }
1615 link ( :posts ) { link_author_posts_url ( object . id ) }
16+ link :resource , 'http://example.com/resource'
1717 link :yet_another do
18- "//example.com/resource/#{ object . id } "
18+ "http: //example.com/resource/#{ object . id } "
1919 end
2020 end
2121
@@ -35,15 +35,15 @@ def test_toplevel_links
3535 adapter : :json_api ,
3636 links : {
3737 self : {
38- href : '//example.com/posts' ,
38+ href : 'http: //example.com/posts' ,
3939 meta : {
4040 stuff : 'value'
4141 }
4242 }
4343 } ) . serializable_hash
4444 expected = {
4545 self : {
46- href : '//example.com/posts' ,
46+ href : 'http: //example.com/posts' ,
4747 meta : {
4848 stuff : 'value'
4949 }
@@ -74,16 +74,16 @@ def test_resource_links
7474 hash = serializable ( @author , adapter : :json_api ) . serializable_hash
7575 expected = {
7676 self : {
77- href : '//example.com/link_author/1337' ,
77+ href : 'http: //example.com/link_author/1337' ,
7878 meta : {
7979 stuff : 'value'
8080 }
8181 } ,
8282 author : 'http://example.com/link_authors/1337' ,
8383 link_authors : 'http://example.com/link_authors' ,
84- other : '//example.com/resource' ,
84+ resource : 'http: //example.com/resource' ,
8585 posts : 'http://example.com/link_authors/1337/posts' ,
86- yet_another : '//example.com/resource/1337'
86+ yet_another : 'http: //example.com/resource/1337'
8787 }
8888 assert_equal ( expected , hash [ :data ] [ :links ] )
8989 end
0 commit comments