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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6f71ffff
Commit
6f71ffff
authored
May 03, 2018
by
blackst0ne
Committed by
Rémy Coutable
May 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace the `groups_management.feature` spinach test with an rspec analog
parent
29f3fc91
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
103 deletions
+54
-103
ee/changelogs/unreleased/blackst0ne-replace-spinach-groups-management-feature.yml
.../blackst0ne-replace-spinach-groups-management-feature.yml
+5
-0
ee/spec/features/projects/settings/user_manages_members_spec.rb
...c/features/projects/settings/user_manages_members_spec.rb
+49
-0
features/groups_management.feature
features/groups_management.feature
+0
-23
features/steps/groups_management.rb
features/steps/groups_management.rb
+0
-76
features/steps/shared/group.rb
features/steps/shared/group.rb
+0
-4
No files found.
ee/changelogs/unreleased/blackst0ne-replace-spinach-groups-management-feature.yml
0 → 100644
View file @
6f71ffff
---
title
:
Replace the `groups_management.feature` spinach test with an rspec analog
merge_request
:
5516
author
:
'
@blackst0ne'
type
:
other
ee/spec/features/projects/settings/user_manages_members_spec.rb
0 → 100644
View file @
6f71ffff
require
"spec_helper"
describe
"User manages members"
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
set
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
shared_examples
"when group membership is unlocked"
do
before
do
group
.
update_attributes
(
membership_lock:
false
)
visit
(
project_project_members_path
(
project
))
end
it
{
expect
(
page
).
to
have_link
(
"Import members"
).
and
have_selector
(
".project-access-select"
)
}
end
shared_examples
"when group membership is locked"
do
before
do
group
.
update_attributes
(
membership_lock:
true
)
visit
(
project_project_members_path
(
project
))
end
it
{
expect
(
page
).
to
have_no_button
(
"Add members"
).
and
have_no_link
(
"Import members"
)
}
end
context
"as project master"
do
before
do
project
.
add_master
(
user
)
end
it_behaves_like
"when group membership is unlocked"
it_behaves_like
"when group membership is locked"
end
context
"as group owner"
do
before
do
group
.
add_owner
(
user
)
end
it_behaves_like
"when group membership is unlocked"
it_behaves_like
"when group membership is locked"
end
end
features/groups_management.feature
deleted
100644 → 0
View file @
29f3fc91
Feature
:
Groups Management
Background
:
Given
"Pete Peters"
is owner of group
"Sourcing"
And
"Open"
is in group
"Sourcing"
And
"Mary Jane"
has master access for project
"Open"
Scenario
:
Project master can add members before lock
Given
I sign in as
"Mary Jane"
And
I go to
"Open"
project members page
Then
I can control user membership
When
Group membership lock is enabled
And
I reload
"Open"
project members page
Then
I cannot control user membership from project page
And
I logout
@javascript
Scenario
:
Group owner lock membership controls
Given
I sign in as
"Pete Peters"
And
I go to group settings page
And
I enable membership lock
And
I go to project settings
Then
I cannot control user membership from project page
And
I logout
features/steps/groups_management.rb
deleted
100644 → 0
View file @
29f3fc91
class
Spinach::Features::GroupsManagement
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedGroup
include
SharedUser
include
Select2Helper
step
'"Open" is in group "Sourcing"'
do
@group
=
Group
.
find_by
(
name:
"Sourcing"
)
@project
||=
create
(
:project
,
name:
"Open"
,
namespace:
@group
)
end
step
'"Mary Jane" has master access for project "Open"'
do
@user
=
User
.
find_by
(
name:
"Mary Jane"
)
||
create
(
:user
,
name:
"Mary Jane"
)
@project
=
Project
.
find_by
(
name:
"Open"
)
@project
.
add_master
(
@user
)
end
step
"Group membership lock is enabled"
do
@group
=
Group
.
find_by
(
name:
"Sourcing"
)
@group
.
update_attributes
(
membership_lock:
true
)
end
step
'I go to "Open" project members page'
do
click_link
'Sourcing / Open'
page
.
within
(
'.nav-sidebar'
)
do
first
(
:link
,
text:
'Settings'
).
click
end
click_link
'Members'
end
step
'I can control user membership'
do
expect
(
page
).
to
have_link
'Import members'
expect
(
page
).
to
have_selector
'.project-access-select'
end
step
'I reload "Open" project members page'
do
visit
root_path
click_link
'Sourcing / Open'
page
.
within
(
'.nav-sidebar'
)
do
first
(
:link
,
text:
'Settings'
).
click
end
click_link
'Members'
end
step
'I go to group settings page'
do
visit
dashboard_groups_path
click_link
'Sourcing'
page
.
within
'.nav-sidebar'
do
first
(
:link
,
text:
'Settings'
).
click
end
page
.
within
'.sidebar-top-level-items > .active'
do
click_link
'General'
end
end
step
'I enable membership lock'
do
check
'group_membership_lock'
click_button
'Save group'
end
step
'I go to project settings'
do
@project
=
Project
.
find_by
(
name:
"Open"
)
page
.
within
'.nav-sidebar'
do
click_link
'Projects'
end
link
=
"/
#{
@project
.
full_path
}
/project_members"
find
(
:xpath
,
"//a[@href=
\"
#{
link
}
\"
]"
).
click
end
step
'I cannot control user membership from project page'
do
expect
(
page
).
not_to
have_button
'Add members'
expect
(
page
).
not_to
have_link
'Import members'
end
end
features/steps/shared/group.rb
View file @
6f71ffff
...
...
@@ -25,10 +25,6 @@ module SharedGroup
is_member_of
(
"Mary Jane"
,
"Guest"
,
Gitlab
::
Access
::
GUEST
)
end
step
'"Pete Peters" is owner of group "Sourcing"'
do
is_member_of
(
"Pete Peters"
,
"Sourcing"
,
Gitlab
::
Access
::
OWNER
)
end
step
'I should see group "TestGroup"'
do
expect
(
page
).
to
have_content
"TestGroup"
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