Permalink
Browse files

fixed broken spec

  • Loading branch information...
1 parent 51c8ae0 commit 8103422333ba8168a16166711333353e96aecfbc @mkristian committed Feb 28, 2013
Showing with 8 additions and 2 deletions.
  1. +1 −0 ixtlan-babel.gemspec
  2. +7 −2 spec/model_filter_spec.rb
View
1 ixtlan-babel.gemspec
@@ -24,4 +24,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'minitest', '~> 4.3'
s.add_development_dependency 'virtus', '~> 0.5.0'
s.add_development_dependency 'multi_json', '~> 1.6'
+ s.add_development_dependency 'json', '~> 1.7'
end
View
9 spec/model_filter_spec.rb
@@ -85,10 +85,11 @@ class Person
json = serializer.to_json(:except => ['id'])
result = deserializer.from_json(json, :except => ['id'])
- expected = Hash[:name => person['name'], :address=>nil, :phone_numbers=>[], :id => nil]
+ expected = Hash[:name => person['name'], :address=>nil, :phone_numbers=>[], :id => nil, :children_names => []]
# travis sees empty array and locally it is nil :(
result.phone_numbers ||= []
+ result.children_names ||= []
result.attributes.keys.dup.each do |k|
result.attributes[ k ].must_equal expected[ k ]
@@ -98,6 +99,7 @@ class Person
# travis sees empty array and locally it is nil :(
result.phone_numbers ||= []
+ result.children_names ||= []
result.attributes.keys.dup.each do |k|
result.attributes[ k ].must_equal expected[ k ]
@@ -110,8 +112,9 @@ class Person
# travis sees empty array and locally it is nil :(
result.phone_numbers ||= []
+ result.children_names ||= []
- expected = Hash[:name => person['name'], :address=>nil, :phone_numbers=>[], :id => nil]
+ expected = Hash[:name => person['name'], :address=>nil, :phone_numbers=>[], :id => nil, :children_names => []]
result.attributes.keys.dup.each do |k|
result.attributes[ k ].must_equal expected[ k ]
end
@@ -120,6 +123,8 @@ class Person
# travis sees empty array and locally it is nil :(
result.phone_numbers ||= []
+ result.children_names ||= []
+
result.attributes.keys.dup.each do |k|
result.attributes[ k ].must_equal expected[ k ]
end

0 comments on commit 8103422

Please sign in to comment.