diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-06 17:43:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-06 12:25:11 +0300 |
commit | 8331036944cc6b7cc376b464eae353882f125113 (patch) | |
tree | 917382162251adb0c80a04d5d0d10c073a0f0687 /spec/features/projects/members | |
parent | 2b9457412c389ed2509774810fc1a7f634845e14 (diff) |
Fixed some specs
CHANGELOG item
Diffstat (limited to 'spec/features/projects/members')
-rw-r--r-- | spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index f136d9ce0fa..6c37a344251 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -14,32 +14,30 @@ feature 'Projects > Members > Master adds member with expiration date', feature: login_as(master) end - scenario 'expiration date is displayed in the members list', js: true do - travel_to Time.zone.parse('2016-08-06 08:00') do - visit namespace_project_settings_members_path(project.namespace, project) - page.within '.users-project-form' do - select2(new_member.id, from: '#user_ids', multiple: true) - fill_in 'expires_at', with: '2016-08-10' - end - find('.users-project-form').click + scenario 'expiration date is displayed in the members list' do + date = 5.days.from_now + visit namespace_project_project_members_path(project.namespace, project) + + page.within '.users-project-form' do + select2(new_member.id, from: '#user_ids', multiple: true) + fill_in 'expires_at', with: date.to_s(:medium) click_on 'Add to project' + end - page.within "#project_member_#{new_member.project_members.first.id}" do - expect(page).to have_content('Expires in 4 days') - end + page.within "#project_member_#{new_member.project_members.first.id}" do + expect(page).to have_content('Expires in 4 days') end end scenario 'change expiration date' do - travel_to Time.zone.parse('2016-08-06 08:00') do - project.team.add_users([new_member.id], :developer, expires_at: '2016-09-06') - visit namespace_project_project_members_path(project.namespace, project) - - page.within "#project_member_#{new_member.project_members.first.id}" do - find('.js-access-expiration-date').set '2016-08-09' - wait_for_ajax - expect(page).to have_content('Expires in 3 days') - end + date = 4.days.from_now + project.team.add_users([new_member.id], :developer, expires_at: Date.today.to_s(:medium)) + visit namespace_project_project_members_path(project.namespace, project) + + page.within "#project_member_#{new_member.project_members.first.id}" do + find('.js-access-expiration-date').set date.to_s(:medium) + wait_for_ajax + expect(page).to have_content('Expires in 3 days') end end end |