summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-10 16:37:02 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-14 12:08:11 +0200
commite50556fcc8d81dae5978bcb3e1dd5104789aab0f (patch)
tree000c94f5da8061efa360c0e580e77261de84e8b1 /spec/models
parent8949af0c9f2aa90b979043a0a6ee264ac0c036b9 (diff)
downloadgitlab-ce-e50556fcc8d81dae5978bcb3e1dd5104789aab0f.tar.gz
Let invites be declined.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/members_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/members_spec.rb b/spec/models/members_spec.rb
index 3f14a111443..c3e47ab7e9a 100644
--- a/spec/models/members_spec.rb
+++ b/spec/models/members_spec.rb
@@ -88,6 +88,23 @@ describe Member do
end
end
+ describe "#decline_invite!" do
+
+ let!(:member) { create(:project_member, invite_email: "user@example.com", user: nil) }
+
+ it "destroys the member" do
+ member.decline_invite!
+
+ expect(member).to be_destroyed
+ end
+
+ it "calls #after_decline_invite" do
+ expect(member).to receive(:after_decline_invite)
+
+ member.decline_invite!
+ end
+ end
+
describe "#generate_invite_token" do
let!(:member) { create(:project_member, invite_email: "user@example.com", user: nil) }