Created
September 8, 2008 15:35
-
-
Save zapnap/9462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'ratings' do | |
before(:each) do | |
@user = users(:quentin) | |
@precious = mock_model(Song, :id => 1) | |
@rating = mock_model(Rating) | |
@user.stub!(:ratings).and_return([]) | |
end | |
it 'loves the precious' do | |
@user.ratings.should_receive(:find_or_create_by_song_id).with(1).and_return(@rating) | |
@rating.should_receive(:love!) | |
@user.love!(@precious) | |
end | |
it 'hates the precious' do | |
@user.ratings.should_receive(:find_or_create_by_song_id).with(1).and_return(@rating) | |
@rating.should_receive(:hate!) | |
@user.hate!(@precious) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment