summaryrefslogtreecommitdiff
path: root/spec/models/members
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-02 18:05:06 +0200
committerRémy Coutable <remy@rymai.me>2016-06-14 13:18:14 +0200
commit515205d3c1c6655302ed0ae44cc5954dead7ae79 (patch)
tree5ac24884eb0e6faf56e1e460260303fbdb14b9cf /spec/models/members
parent6d103a2f4764441b1650ba6d790732056c9a8516 (diff)
downloadgitlab-ce-515205d3c1c6655302ed0ae44cc5954dead7ae79.tar.gz
UI and copywriting improvements13948-access-request-to-projects-and-groups
+ Move 'Edit Project/Group' out of membership-related partial + Show the access request buttons only to logged-in users + Put the request access buttons out of in a more visible button + Improve the copy in the #remove_member_message helper Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/members')
-rw-r--r--spec/models/members/group_member_spec.rb22
-rw-r--r--spec/models/members/project_member_spec.rb22
2 files changed, 28 insertions, 16 deletions
diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb
index c3070d4cb78..eeb74a462ac 100644
--- a/spec/models/members/group_member_spec.rb
+++ b/spec/models/members/group_member_spec.rb
@@ -51,24 +51,30 @@ describe GroupMember, models: true do
end
end
- describe 'after accept_request' do
- let(:member) { create(:group_member, user: nil, created_by: build_stubbed(:user), requested_at: Time.now) }
+ describe '#after_accept_request' do
+ it 'calls NotificationService.accept_group_access_request' do
+ member = create(:group_member, user: build_stubbed(:user), requested_at: Time.now)
- it "calls #accept_group_access_request" do
expect_any_instance_of(NotificationService).to receive(:new_group_member)
- member.accept_request
+ member.__send__(:after_accept_request)
end
end
- describe 'after decline_request' do
- let(:member) { create(:group_member, user: nil, created_by: build_stubbed(:user), requested_at: Time.now) }
+ describe '#post_decline_request' do
+ it 'calls NotificationService.decline_group_access_request' do
+ member = create(:group_member, user: build_stubbed(:user), requested_at: Time.now)
- it "calls #decline_group_access_request" do
expect_any_instance_of(NotificationService).to receive(:decline_group_access_request)
- member.decline_request
+ member.__send__(:post_decline_request)
end
end
+
+ describe '#real_source_type' do
+ subject { create(:group_member).real_source_type }
+
+ it { is_expected.to eq 'Group' }
+ end
end
end
diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb
index 99b3c77c6cd..1e466f9c620 100644
--- a/spec/models/members/project_member_spec.rb
+++ b/spec/models/members/project_member_spec.rb
@@ -33,6 +33,12 @@ describe ProjectMember, models: true do
it { is_expected.to include_module(Gitlab::ShellAdapter) }
end
+ describe '#real_source_type' do
+ subject { create(:project_member).real_source_type }
+
+ it { is_expected.to eq 'Project' }
+ end
+
describe "#destroy" do
let(:owner) { create(:project_member, access_level: ProjectMember::OWNER) }
let(:project) { owner.project }
@@ -137,23 +143,23 @@ describe ProjectMember, models: true do
end
describe 'notifications' do
- describe 'after accept_request' do
- let(:member) { create(:project_member, user: nil, created_by: build_stubbed(:user), requested_at: Time.now) }
+ describe '#after_accept_request' do
+ it 'calls NotificationService.new_project_member' do
+ member = create(:project_member, user: build_stubbed(:user), requested_at: Time.now)
- it 'calls #accept_project_access_request' do
expect_any_instance_of(NotificationService).to receive(:new_project_member)
- member.accept_request
+ member.__send__(:after_accept_request)
end
end
- describe 'after decline_request' do
- let(:member) { create(:project_member, user: nil, created_by: build_stubbed(:user), requested_at: Time.now) }
+ describe '#post_decline_request' do
+ it 'calls NotificationService.decline_project_access_request' do
+ member = create(:project_member, user: build_stubbed(:user), requested_at: Time.now)
- it 'calls #decline_project_access_request' do
expect_any_instance_of(NotificationService).to receive(:decline_project_access_request)
- member.decline_request
+ member.__send__(:post_decline_request)
end
end
end