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
Léo-Paul Géneau
gitlab-ce
Commits
6060d652
Commit
6060d652
authored
Sep 10, 2017
by
Vitaliy @blackst0ne Klachkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the project/team_management.feature spinach test with an rspec analog
parent
5d952f75
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
113 deletions
+73
-113
changelogs/unreleased/replace_team_management-feature.yml
changelogs/unreleased/replace_team_management-feature.yml
+5
-0
features/project/team_management.feature
features/project/team_management.feature
+0
-26
features/steps/project/team_management.rb
features/steps/project/team_management.rb
+0
-87
spec/features/projects/settings/user_manages_project_members_spec.rb
...es/projects/settings/user_manages_project_members_spec.rb
+68
-0
No files found.
changelogs/unreleased/replace_team_management-feature.yml
0 → 100644
View file @
6060d652
---
title
:
Replace the project/team_management.feature spinach test with an rspec analog
merge_request
:
14173
author
:
Vitaliy @blackst0ne Klachkov
type
:
other
features/project/team_management.feature
deleted
100644 → 0
View file @
5d952f75
Feature
:
Project Team Management
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And
gitlab user
"Mike"
And
gitlab user
"Dmitriy"
And
"Dmitriy"
is
"Shop"
developer
And
I visit project
"Shop"
team page
Scenario
:
Cancel team member
Given
I click cancel link for
"Dmitriy"
Then
I visit project
"Shop"
team page
And
I should not see
"Dmitriy"
in team list
Scenario
:
Import team from another project
Given
I own project
"Website"
And
"Mike"
is
"Website"
reporter
When
I visit project
"Shop"
team page
And
I click link
"Import team from another project"
And
I submit
"Website"
project for import team
Then
I should see
"Mike"
in team list as
"Reporter"
Scenario
:
See all members of projects shared group
Given
I share project with group
"OpenSource"
And
I visit project
"Shop"
team page
Then
I should see
"Opensource"
group user listing
features/steps/project/team_management.rb
deleted
100644 → 0
View file @
5d952f75
class
Spinach::Features::ProjectTeamManagement
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
Select2Helper
step
'I should not see "Dmitriy" in team list'
do
user
=
User
.
find_by
(
name:
"Dmitriy"
)
expect
(
page
).
not_to
have_content
(
user
.
name
)
expect
(
page
).
not_to
have_content
(
user
.
username
)
end
step
'I should see "Mike" in team list as "Reporter"'
do
user
=
User
.
find_by
(
name:
'Mike'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
page
.
within
"#project_member_
#{
project_member
.
id
}
"
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
step
'gitlab user "Mike"'
do
create
(
:user
,
name:
"Mike"
)
end
step
'gitlab user "Dmitriy"'
do
create
(
:user
,
name:
"Dmitriy"
)
end
step
'"Dmitriy" is "Shop" developer'
do
user
=
User
.
find_by
(
name:
"Dmitriy"
)
project
=
Project
.
find_by
(
name:
"Shop"
)
project
.
team
<<
[
user
,
:developer
]
end
step
'I own project "Website"'
do
@project
=
create
(
:project
,
name:
"Website"
,
namespace:
@user
.
namespace
)
@project
.
team
<<
[
@user
,
:master
]
end
step
'"Mike" is "Website" reporter'
do
user
=
User
.
find_by
(
name:
"Mike"
)
project
=
Project
.
find_by
(
name:
"Website"
)
project
.
team
<<
[
user
,
:reporter
]
end
step
'I click link "Import team from another project"'
do
page
.
within
'.users-project-form'
do
click_link
"Import"
end
end
When
'I submit "Website" project for import team'
do
project
=
Project
.
find_by
(
name:
"Website"
)
select
project
.
name_with_namespace
,
from:
'source_project_id'
click_button
'Import'
end
step
'I click cancel link for "Dmitriy"'
do
project
=
Project
.
find_by
(
name:
"Shop"
)
user
=
User
.
find_by
(
name:
'Dmitriy'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user
.
id
)
page
.
within
"#project_member_
#{
project_member
.
id
}
"
do
click_link
(
'Remove user from project'
)
end
end
step
'I share project with group "OpenSource"'
do
project
=
Project
.
find_by
(
name:
'Shop'
)
os_group
=
create
(
:group
,
name:
'OpenSource'
)
create
(
:project
,
group:
os_group
)
@os_user1
=
create
(
:user
)
@os_user2
=
create
(
:user
)
os_group
.
add_owner
(
@os_user1
)
os_group
.
add_user
(
@os_user2
,
Gitlab
::
Access
::
DEVELOPER
)
share_link
=
project
.
project_group_links
.
new
(
group_access:
Gitlab
::
Access
::
MASTER
)
share_link
.
group_id
=
os_group
.
id
share_link
.
save!
end
step
'I should see "Opensource" group user listing'
do
page
.
within
'.project-members-groups'
do
expect
(
page
).
to
have_content
(
'OpenSource'
)
expect
(
first
(
'.group_member'
)).
to
have_content
(
'Master'
)
end
end
end
spec/features/projects/settings/user_manages_project_members_spec.rb
0 → 100644
View file @
6060d652
require
'spec_helper'
describe
'User manages project members'
do
let
(
:group
)
{
create
(
:group
,
name:
'OpenSource'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project2
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user_dmitriy
)
{
create
(
:user
,
name:
'Dmitriy'
)
}
let
(
:user_mike
)
{
create
(
:user
,
name:
'Mike'
)
}
before
do
project
.
add_master
(
user
)
project
.
add_developer
(
user_dmitriy
)
sign_in
(
user
)
end
it
'cancels a team member'
do
visit
(
project_project_members_path
(
project
))
project_member
=
project
.
project_members
.
find_by
(
user_id:
user_dmitriy
.
id
)
page
.
within
(
"#project_member_
#{
project_member
.
id
}
"
)
do
click_link
(
'Remove user from project'
)
end
visit
(
project_project_members_path
(
project
))
expect
(
page
).
not_to
have_content
(
user_dmitriy
.
name
)
expect
(
page
).
not_to
have_content
(
user_dmitriy
.
username
)
end
it
'imports a team from another project'
do
project2
.
add_master
(
user
)
project2
.
add_reporter
(
user_mike
)
visit
(
project_project_members_path
(
project
))
page
.
within
(
'.users-project-form'
)
do
click_link
(
'Import'
)
end
select
(
project2
.
name_with_namespace
,
from:
'source_project_id'
)
click_button
(
'Import'
)
project_member
=
project
.
project_members
.
find_by
(
user_id:
user_mike
.
id
)
page
.
within
(
"#project_member_
#{
project_member
.
id
}
"
)
do
expect
(
page
).
to
have_content
(
'Mike'
)
expect
(
page
).
to
have_content
(
'Reporter'
)
end
end
it
'shows all members of project shared group'
do
group
.
add_owner
(
user
)
group
.
add_developer
(
user_dmitriy
)
share_link
=
project
.
project_group_links
.
new
(
group_access:
Gitlab
::
Access
::
MASTER
)
share_link
.
group_id
=
group
.
id
share_link
.
save!
visit
(
project_project_members_path
(
project
))
page
.
within
(
'.project-members-groups'
)
do
expect
(
page
).
to
have_content
(
'OpenSource'
)
expect
(
first
(
'.group_member'
)).
to
have_content
(
'Master'
)
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