Created
November 24, 2010 02:55
-
-
Save kidpollo/713016 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
it 'should notify user and add to leader board if user is an expert' do | |
user = mock_model(User, :is_expert? => true) | |
topic = mock_model(Topic, :id => 1) | |
collection = mock('col') | |
collection.should_receive(:<<).with(user) | |
topic.should_receive(:experts).and_return(collection) | |
user.should_receive(:notify_about_topic!).with(topic) | |
User.should_receive(:find).with(1).and_return(user) | |
Topic.should_receive(:find).with(1).and_return(topic) | |
post :notify, :topic_id => topic.id, :id => 1, :format => 'js' | |
response.should be_succes | |
assigns(:user).should == user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment