Skip to content

Instantly share code, notes, and snippets.

@russ
Created March 2, 2011 00:15
Show Gist options
  • Save russ/850195 to your computer and use it in GitHub Desktop.
Save russ/850195 to your computer and use it in GitHub Desktop.
subject do
Course.create!({:title => 'Test Course', :image => File.open(File.join(Rails.root, 'public', 'images', 'test-image.gif'))})
end
describe "when an image is attached" do
it "should respond to an image object" do
subject.image.class.should == Paperclip::Attachment
end
it "should have a vaild image that's not missing" do
subject.image.url.should_not match(/missing\.png$/)
end
it "should have the large size set as default" do
subject.image.url(:large).should == subject.image.url
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment