diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /spec/features/groups/members | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'spec/features/groups/members')
-rw-r--r-- | spec/features/groups/members/manage_groups_spec.rb | 11 | ||||
-rw-r--r-- | spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb | 15 |
2 files changed, 14 insertions, 12 deletions
diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb index 2dfcd941b4f..d822a5ea871 100644 --- a/spec/features/groups/members/manage_groups_spec.rb +++ b/spec/features/groups/members/manage_groups_spec.rb @@ -63,6 +63,7 @@ RSpec.describe 'Groups > Members > Manage groups', :js do context 'when group link exists' do let_it_be(:shared_with_group) { create(:group) } let_it_be(:shared_group) { create(:group) } + let_it_be(:expiration_date) { 5.days.from_now.to_date } let(:additional_link_attrs) { {} } @@ -115,29 +116,29 @@ RSpec.describe 'Groups > Members > Manage groups', :js do click_groups_tab page.within first_row do - fill_in 'Expiration date', with: 5.days.from_now.to_date + fill_in 'Expiration date', with: expiration_date find_field('Expiration date').native.send_keys :enter wait_for_requests - expect(page).to have_content(/in \d days/) + expect(page).to have_field('Expiration date', with: expiration_date) end end context 'when expiry date is set' do - let(:additional_link_attrs) { { expires_at: 5.days.from_now.to_date } } + let(:additional_link_attrs) { { expires_at: expiration_date } } it 'clears expiry date' do click_groups_tab page.within first_row do - expect(page).to have_content(/in \d days/) + expect(page).to have_field('Expiration date', with: expiration_date) find('[data-testid="clear-button"]').click wait_for_requests - expect(page).to have_content('No expiration set') + expect(page).to have_field('Expiration date', with: '') end end end diff --git a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb index ddf3c6d8f9b..86185b8dd32 100644 --- a/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/groups/members/master_adds_member_with_expiration_date_spec.rb @@ -8,6 +8,7 @@ RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js let_it_be(:user1) { create(:user, name: 'John Doe') } let_it_be(:group) { create(:group) } + let_it_be(:expiration_date) { 5.days.from_now.to_date } let(:new_member) { create(:user, name: 'Mary Jane') } @@ -19,10 +20,10 @@ RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js it 'expiration date is displayed in the members list' do visit group_group_members_path(group) - invite_member(new_member.name, role: 'Guest', expires_at: 5.days.from_now.to_date) + invite_member(new_member.name, role: 'Guest', expires_at: expiration_date) page.within second_row do - expect(page).to have_content(/in \d days/) + expect(page).to have_field('Expiration date', with: expiration_date) end end @@ -31,27 +32,27 @@ RSpec.describe 'Groups > Members > Owner adds member with expiration date', :js visit group_group_members_path(group) page.within second_row do - fill_in 'Expiration date', with: 5.days.from_now.to_date + fill_in 'Expiration date', with: expiration_date find_field('Expiration date').native.send_keys :enter wait_for_requests - expect(page).to have_content(/in \d days/) + expect(page).to have_field('Expiration date', with: expiration_date) end end it 'clears expiration date' do - create(:group_member, :developer, user: new_member, group: group, expires_at: 5.days.from_now.to_date) + create(:group_member, :developer, user: new_member, group: group, expires_at: expiration_date) visit group_group_members_path(group) page.within second_row do - expect(page).to have_content(/in \d days/) + expect(page).to have_field('Expiration date', with: expiration_date) find('[data-testid="clear-button"]').click wait_for_requests - expect(page).to have_content('No expiration set') + expect(page).to have_field('Expiration date', with: '') end end end |