require File.dirname(__FILE__) + '/../test_helper'
require 'resourceful/serialize'

class SerializeTest < Test::Unit::TestCase
  fixtures :parties, :people, :parties_people
  
  def test_should_generate_hash_for_model
    assert_equal(hash_for_fun_party,
                 parties(:fun_party).to_resourceful_hash([:name, {:people => [:name]}]))
  end
  
  def test_to_s_should_return_format
    assert_equal({'party' => hash_for_fun_party},
                 YAML.load(parties(:fun_party).serialize(:yaml, :attributes => [:name, {:people => [:name]}])))
  end
end

require File.dirname(__FILE__) + '/../test_helper'
require 'resourceful/serialize'

class SerializeTest < Test::Unit::TestCase
  fixtures :parties, :people, :parties_people
  
  def test_should_generate_hash_for_model
    assert_equal(hash_for_fun_party,
                 parties(:fun_party).to_serializable([:name, {:people => [:name]}]))
  end
  
  def test_to_s_should_return_format
    assert_equal({'party' => hash_for_fun_party},
                 YAML.load(parties(:fun_party).serialize(:yaml, :attributes => [:name, {:people => [:name]}])))
  end
end

Fix a breaking test. Want to keep these working until we switch over to specs entirely.
Fix a breaking test. Want to keep these working until we switch over to specs entirely.


git-svn-id: 30fef0787527f3d4b2d3639a5d6955e4dc84682e@103 c18eca5a-f828-0410-9317-b2e082e89db6
