@@ -23,7 +23,6 @@ def method_missing(meth, *args)
23
23
end
24
24
end
25
25
26
-
27
26
def setup
28
27
@author = Author . new ( name : 'Steve K.' )
29
28
@author . bio = nil
@@ -43,11 +42,11 @@ def setup
43
42
@comment_serializer = CommentSerializer . new ( @comment )
44
43
end
45
44
46
- def test_has_many
45
+ def test_has_many_and_has_one
47
46
assert_equal (
48
47
{ posts : { type : :has_many , association_options : { embed : :ids } } ,
49
48
roles : { type : :has_many , association_options : { embed : :ids } } ,
50
- bio : { type : :belongs_to , association_options : { } } } ,
49
+ bio : { type : :has_one , association_options : { } } } ,
51
50
@author_serializer . class . _associations
52
51
)
53
52
@author_serializer . each_association do |name , serializer , options |
@@ -67,7 +66,11 @@ def test_has_many
67
66
end
68
67
69
68
def test_belongs_to
70
- assert_equal ( { post : { type : :belongs_to , association_options : { } } , :author => { :type => :belongs_to , :association_options => { } } } , @comment_serializer . class . _associations )
69
+ assert_equal (
70
+ { post : { type : :belongs_to , association_options : { } } ,
71
+ author : { type : :belongs_to , association_options : { } } } ,
72
+ @comment_serializer . class . _associations
73
+ )
71
74
@comment_serializer . each_association do |name , serializer , options |
72
75
if name == :post
73
76
assert_equal ( { } , options )
0 commit comments