November 2010
1 post
My favorite Spec of the day
Here is the controller spec!
def notify
@user = User.find(params[:id])
if @user.is_expert?
@topic.experts << @user
end @
user.notify_about_topic!(@topic)
end
And the implementation
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 =...