Listing 15.5. Test moduowy dla klasy modelu logicznego
require File.dirname(__FILE__) + '/../../test_helper'

class MovieTestCase < Test::Unit::TestCase
  def test_logical_movie_get
    p = Physical::Movie.create!(
      :name => 'Kiedy Harry pozna Sally',
      :length_minutes => 120,
      :rating => Physical::Rating::PG13)
    l = Logical::Movie.get(p.id)

    assert l.name == p.name
    assert l.length_minutes == p.length_minutes
    assert l.rating_id == p.rating_id
    assert l.rating_description = p.rating_description
  end
end

