Skip to content

Instantly share code, notes, and snippets.

@mattwynne
Forked from dchelimsky/photo.rb
Created March 23, 2010 23:56
Show Gist options
  • Save mattwynne/341831 to your computer and use it in GitHub Desktop.
Save mattwynne/341831 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe PhotoAlbum do
describe 'adding a new photo' do
describe "when the album has no photos" do
before(:each) do
@photo_album = stub_model(PhotoAlbum)
end
it "should set the cover of the album to be the new photo" do
photo = stub_model(Photo)
@photo_album.photos << photo
@photo_album.cover.should == photo
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment