summaryrefslogtreecommitdiff
path: root/spec/features/projects
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-01-30 13:56:04 +0000
committerPhil Hughes <me@iamphill.com>2017-02-06 09:38:53 +0000
commit12cc9a530c6540075c78239416027eb706fac386 (patch)
treef6846d1a9033eb767b19a9236a16ee0d5c7c6eaa /spec/features/projects
parent5942247dd6f73f5e92a3c635873e62d0efbf9ea8 (diff)
downloadgitlab-ce-12cc9a530c6540075c78239416027eb706fac386.tar.gz
Changed date check testremove-jquery-ui-datepicker
Diffstat (limited to 'spec/features/projects')
-rw-r--r--spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb42
1 files changed, 23 insertions, 19 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 6c37a344251..c3f45be6e4b 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
@@ -15,29 +15,33 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
end
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')
+ travel_to Time.zone.parse('2016-08-06 08:00') do
+ date = 4.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
end
end
scenario 'change expiration date' do
- 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')
+ travel_to Time.zone.parse('2016-08-06 08:00') do
+ date = 3.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
end