impress/spec/models/parent_swf_asset_relationship_spec.rb

24 lines
659 B
Ruby
Raw Normal View History

require 'spec_helper'
describe ParentSwfAssetRelationship do
context "a relationship" do
before(:each) do
@relationship = ParentSwfAssetRelationship.new
Factory.create :item, :name => 'foo'
@relationship.parent_id = 1
end
specify "should belong to an item" do
@relationship.item.id.should == 1
@relationship.item.name.should == 'foo'
end
specify "should belong to an swf_asset" do
Factory.create :swf_asset, :type => 'object', :id => 1
@relationship.swf_asset_id = 1
@relationship.swf_asset.id.should == 1
@relationship.swf_asset.type.should == 'object'
end
end
end