remove scope as a separate concept and pass it in

as an option.
This commit is contained in:
Yehuda Katz
2012-01-11 21:16:02 -07:00
parent 4ad9c64e46
commit 671fc14888
7 changed files with 62 additions and 54 deletions

View File

@@ -43,7 +43,7 @@ class AssociationTest < ActiveModel::TestCase
attributes :title, :body
end
@post_serializer = @post_serializer_class.new(@post, nil)
@post_serializer = @post_serializer_class.new(@post)
@hash = {}
@root_hash = {}
@@ -321,7 +321,7 @@ class AssociationTest < ActiveModel::TestCase
def test_when_it_is_included
post_serializer = @post_serializer_class.new(
@post, nil, :include => [:comments]
@post, :include => [:comments]
)
json = post_serializer.as_json
@@ -340,7 +340,7 @@ class AssociationTest < ActiveModel::TestCase
def test_when_it_is_not_included
post_serializer = @post_serializer_class.new(
@post, nil, :include => []
@post, :include => []
)
json = post_serializer.as_json
@@ -356,7 +356,7 @@ class AssociationTest < ActiveModel::TestCase
def test_when_it_is_excluded
post_serializer = @post_serializer_class.new(
@post, nil, :exclude => [:comments]
@post, :exclude => [:comments]
)
json = post_serializer.as_json
@@ -372,7 +372,7 @@ class AssociationTest < ActiveModel::TestCase
def test_when_it_is_not_excluded
post_serializer = @post_serializer_class.new(
@post, nil, :exclude => []
@post, :exclude => []
)
json = post_serializer.as_json