Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d21b17f2ab
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (13 sloc) 0.488 kB
require 'spec_helper'
describe 'Polymorph' do
before do
@owned_by_user = create :post, :owner_type => 'User'
@owned_by_mammal = create :post, :owner_type => 'Mammal'
end
it "should set the correct expected values on a _for column method with Class" do
Post.for_owner_type(User).should == [@owned_by_user]
end
it "should set the correct expected values on a _for column method with String" do
Post.for_owner_type('User').should == [@owned_by_user]
end
end
Jump to Line
Something went wrong with that request. Please try again.