diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-21 17:49:06 -0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 12:13:46 +0200 |
commit | 5a9ede472150ec78f8410ae15cf782095c8f056c (patch) | |
tree | 5cbdbfb971329960011e8b3a3544e583f9551f6c /spec/models/members | |
parent | dad88568f34bfda5f7fe34672bc5099c80226138 (diff) | |
download | gitlab-ce-5a9ede472150ec78f8410ae15cf782095c8f056c.tar.gz |
Update mock and stub syntax for specs
Diffstat (limited to 'spec/models/members')
-rw-r--r-- | spec/models/members/group_member_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb index 7c10c9f0f48..652026729bb 100644 --- a/spec/models/members/group_member_spec.rb +++ b/spec/models/members/group_member_spec.rb @@ -24,8 +24,11 @@ describe GroupMember do describe "#after_create" do it "should send email to user" do membership = build(:group_member) - membership.stub(notification_service: double('NotificationService').as_null_object) + + allow(membership).to receive(:notification_service). + and_return(double('NotificationService').as_null_object) expect(membership).to receive(:notification_service) + membership.save end end @@ -33,7 +36,8 @@ describe GroupMember do describe "#after_update" do before do @group_member = create :group_member - @group_member.stub(notification_service: double('NotificationService').as_null_object) + allow(@group_member).to receive(:notification_service). + and_return(double('NotificationService').as_null_object) end it "should send email to user" do |