BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9f87b34f
Unverified
Commit
9f87b34f
authored
Jun 26, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine group leave feature specs in one file
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f0886918
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
37 deletions
+62
-37
last_owner_cannot_leave_group_spec.rb
...ures/groups/members/last_owner_cannot_leave_group_spec.rb
+0
-16
leave_group_spec.rb
spec/features/groups/members/leave_group_spec.rb
+62
-0
member_leaves_group_spec.rb
spec/features/groups/members/member_leaves_group_spec.rb
+0
-21
No files found.
spec/features/groups/members/last_owner_cannot_leave_group_spec.rb
deleted
100644 → 0
View file @
f0886918
require
'spec_helper'
feature
'Groups > Members > Last owner cannot leave group'
,
feature:
true
do
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
background
do
group
.
add_owner
(
owner
)
gitlab_sign_in
(
owner
)
visit
group_path
(
group
)
end
scenario
'user does not see a "Leave group" link'
do
expect
(
page
).
not_to
have_content
'Leave group'
end
end
spec/features/groups/members/leave_group_spec.rb
0 → 100644
View file @
9f87b34f
require
'spec_helper'
feature
'Groups > Members > Leave group'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:other_user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
background
do
gitlab_sign_in
(
user
)
end
scenario
'guest leaves the group'
do
group
.
add_guest
(
user
)
group
.
add_owner
(
other_user
)
visit
group_path
(
group
)
click_link
'Leave group'
expect
(
current_path
).
to
eq
(
dashboard_groups_path
)
expect
(
page
).
to
have_content
left_group_message
(
group
)
expect
(
group
.
members
).
not_to
include
(
user
)
end
scenario
'guest leaves the group as last member'
do
group
.
add_guest
(
user
)
visit
group_path
(
group
)
click_link
'Leave group'
expect
(
current_path
).
to
eq
(
dashboard_groups_path
)
expect
(
page
).
to
have_content
left_group_message
(
group
)
expect
(
group
.
members
).
not_to
include
(
user
)
end
scenario
'owner leaves the group if they is not the last owner'
do
group
.
add_owner
(
user
)
group
.
add_owner
(
other_user
)
visit
group_path
(
group
)
click_link
'Leave group'
expect
(
current_path
).
to
eq
(
dashboard_groups_path
)
expect
(
page
).
to
have_content
left_group_message
(
group
)
expect
(
group
.
members
).
not_to
include
(
user
)
end
scenario
'owner can not leave the group if they is a last owner'
do
group
.
add_owner
(
user
)
visit
group_path
(
group
)
expect
(
page
).
not_to
have_content
'Leave group'
visit
group_group_members_path
(
group
)
expect
(
find
(
:css
,
'.project-members-page li'
,
text:
user
.
name
)).
not_to
have_selector
(
:css
,
'a.btn-remove'
)
end
def
left_group_message
(
group
)
"You left the
\"
#{
group
.
name
}
\"
"
end
end
spec/features/groups/members/member_leaves_group_spec.rb
deleted
100644 → 0
View file @
f0886918
require
'spec_helper'
feature
'Groups > Members > Member leaves group'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:owner
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:public
)
}
background
do
group
.
add_owner
(
owner
)
group
.
add_developer
(
user
)
gitlab_sign_in
(
user
)
visit
group_path
(
group
)
end
scenario
'user leaves group'
do
click_link
'Leave group'
expect
(
current_path
).
to
eq
(
dashboard_groups_path
)
expect
(
group
.
users
.
exists?
(
user
.
id
)).
to
be_falsey
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