Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment