Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Jun 5, 2012
1 parent 681bcf5 commit 7afac9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/generators_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def test_uses_given_parent
def test_generates_attributes_and_associations
run_generator
assert_file "app/serializers/account_serializer.rb" do |serializer|
assert_match(/^ attributes :name, :description$/, serializer)
assert_match(/^ attributes :id, :name, :description$/, serializer)
assert_match(/^ has_one :business$/, serializer)
end
end

def test_with_no_attributes_does_not_add_extra_space
run_generator ["account"]
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ActiveModel::Serializer\nend/
assert_file "app/serializers/account_serializer.rb", /class AccountSerializer < ActiveModel::Serializer\n attributes :id\nend/
end
end

0 comments on commit 7afac9c

Please sign in to comment.