Browse files

Test the serialized types of virtual columns in XML

The previous tests were passing, because nothing ever looked at the
generated XML. What was previously being generated was
`<firstname type="NilClass">...`, which is not consistent with all other
cases where there is not a known type.
  • Loading branch information...
1 parent 260c384 commit 29cbfa2f33b2d0e2d16a203941998687af7831db Geoff Petrie & Sean Griffin committed with geopet Jun 1, 2014
@@ -184,8 +184,6 @@ def compute_type
elsif klass.columns_hash.key?(name)
- else
- NilClass
{ :text => :string,
@@ -416,8 +416,9 @@ def test_should_produce_xml_for_methods_returning_array
def test_should_support_aliased_attributes
xml ="name as firstname").to_xml
- array = Hash.from_xml(xml)['authors']
- assert_equal array.size, { |author| author.has_key? 'firstname' }.size
+ Author.all.each do |author|
+ assert xml.include?(%(<firstname>#{}</firstname>)), xml
+ end
def test_array_to_xml_including_has_many_association

0 comments on commit 29cbfa2

Please sign in to comment.