diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-02 19:05:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-14 14:18:14 +0300 |
commit | 515205d3c1c6655302ed0ae44cc5954dead7ae79 (patch) | |
tree | 5ac24884eb0e6faf56e1e460260303fbdb14b9cf /spec/models/members/group_member_spec.rb | |
parent | 6d103a2f4764441b1650ba6d790732056c9a8516 (diff) |
UI and copywriting improvements
+ 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/group_member_spec.rb')
-rw-r--r-- | spec/models/members/group_member_spec.rb | 22 |
1 files changed, 14 insertions, 8 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 |