Skip to content

Commit

Permalink
'pioneer_spec' was refactored.
Browse files Browse the repository at this point in the history
  • Loading branch information
MitinPavel committed Oct 15, 2010
1 parent 57ba2fc commit 599fb4e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions spec/pioneer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@
before do
@email_service, @sms_service = mock, mock
@comment = Comment.new 'some text', 'dummy post'
@notification_service = NotificationService.new @email_service, @sms_service
end

it "should notify the post author by email" do
@email_service.expects(:deliver_new_comment_email).with @comment
@sms_service.expects :deliver_new_comment_sms

notification_service.notify_about @comment
@notification_service.notify_about @comment
end

it "should notify the post author by sms" do
@email_service.expects :deliver_new_comment_email
@sms_service.expects(:deliver_new_comment_sms).with @comment

notification_service.notify_about @comment
end

def notification_service
NotificationService.new @email_service, @sms_service
@notification_service.notify_about @comment
end
end

0 comments on commit 599fb4e

Please sign in to comment.