diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-09 19:51:31 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-03 17:57:48 +0300 |
commit | c8b1311934935c7ac7fd901558e19ac496fbad2c (patch) | |
tree | 53760b417a85f51b76ee21a343834b20bc45ede3 /spec/services/members | |
parent | 3158f57dba6dcef3e586ae8fced7deb6fdbd6dc0 (diff) |
Fix a few things after the initial improvment to Members::DestroyService
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/services/members')
-rw-r--r-- | spec/services/members/destroy_service_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/members/destroy_service_spec.rb b/spec/services/members/destroy_service_spec.rb index 06a6b0083c9..9995f3488af 100644 --- a/spec/services/members/destroy_service_spec.rb +++ b/spec/services/members/destroy_service_spec.rb @@ -98,6 +98,15 @@ describe Members::DestroyService, services: true do it_behaves_like 'a service destroying a member' do let(:source) { group } end + + context 'when given a :id' do + let(:params) { { id: project.members.find_by!(user_id: user.id).id } } + + it 'destroys the member' do + expect { described_class.new(project, user, params).execute }. + to change { project.members.count }.by(-1) + end + end end end end |