Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
9accb302
Commit
9accb302
authored
Aug 06, 2016
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set explicit time in tests so they return consistent results regardless of the hour of execution.
parent
f5645355
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
...s/members/master_adds_member_with_expiration_date_spec.rb
+23
-18
No files found.
spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb
View file @
9accb302
...
@@ -2,6 +2,7 @@ require 'spec_helper'
...
@@ -2,6 +2,7 @@ require 'spec_helper'
feature
'Projects > Members > Master adds member with expiration date'
,
feature:
true
,
js:
true
do
feature
'Projects > Members > Master adds member with expiration date'
,
feature:
true
,
js:
true
do
include
Select2Helper
include
Select2Helper
include
ActiveSupport
::
Testing
::
TimeHelpers
let!
(
:master
)
{
create
(
:user
)
}
let!
(
:master
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
...
@@ -13,11 +14,12 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -13,11 +14,12 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
end
end
scenario
'expiration date is displayed in the members list'
do
scenario
'expiration date is displayed in the members list'
do
travel_to
Time
.
zone
.
parse
(
"2016-08-06 08:00"
)
do
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.users-project-form'
do
page
.
within
'.users-project-form'
do
select2
(
new_member
.
id
,
from:
'#user_ids'
,
multiple:
true
)
select2
(
new_member
.
id
,
from:
'#user_ids'
,
multiple:
true
)
fill_in
'Access expiration date'
,
with:
4
.
days
.
from_now
fill_in
'Access expiration date'
,
with:
"2016-08-10"
click_on
'Add users to project'
click_on
'Add users to project'
end
end
...
@@ -25,16 +27,19 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
...
@@ -25,16 +27,19 @@ feature 'Projects > Members > Master adds member with expiration date', feature:
expect
(
page
).
to
have_content
(
'Expires in 4 days'
)
expect
(
page
).
to
have_content
(
'Expires in 4 days'
)
end
end
end
end
end
scenario
'change expiration date'
do
scenario
'change expiration date'
do
project
.
team
.
add_users
([
new_member
.
id
],
:developer
,
expires_at:
1
.
month
.
from_now
)
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
)
visit
namespace_project_project_members_path
(
project
.
namespace
,
project
)
page
.
within
'.project_member:first-child'
do
page
.
within
'.project_member:first-child'
do
click_on
'Edit'
click_on
'Edit'
fill_in
'Access expiration date'
,
with:
2
.
days
.
from_now
fill_in
'Access expiration date'
,
with:
"2016-08-09"
click_on
'Save'
click_on
'Save'
expect
(
page
).
to
have_content
(
'Expires in 2 days'
)
expect
(
page
).
to
have_content
(
'Expires in 3 days'
)
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment