24 lines
659 B
Ruby
24 lines
659 B
Ruby
|
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
|