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
Boxiang Sun
gitlab-ce
Commits
909a0ff3
Commit
909a0ff3
authored
Jun 20, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and remove duplicate specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
bf05ca88
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
111 deletions
+2
-111
features/dashboard/group.feature
features/dashboard/group.feature
+0
-44
features/steps/dashboard/group.rb
features/steps/dashboard/group.rb
+0
-42
spec/controllers/groups/group_members_controller_spec.rb
spec/controllers/groups/group_members_controller_spec.rb
+1
-3
spec/controllers/projects/project_members_controller_spec.rb
spec/controllers/projects/project_members_controller_spec.rb
+1
-5
spec/features/groups/members/member_leaves_group_spec.rb
spec/features/groups/members/member_leaves_group_spec.rb
+0
-1
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+0
-16
No files found.
features/dashboard/group.feature
View file @
909a0ff3
...
...
@@ -5,53 +5,9 @@ Feature: Dashboard Group
And
"John Doe"
is owner of group
"Owned"
And
"John Doe"
is guest of group
"Guest"
# Leave groups
@javascript
Scenario
:
Owner should be able to leave from group if he is not the last owner
Given
"Mary Jane"
is owner of group
"Owned"
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should see group
"Guest"
in group list
When
I click on the
"Leave"
button for group
"Owned"
And
I visit dashboard groups page
Then
I should not see group
"Owned"
in group list
Then
I should see group
"Guest"
in group list
@javascript
Scenario
:
Owner should not be able to leave from group if he is the last owner
Given
"Mary Jane"
is guest of group
"Owned"
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should see group
"Guest"
in group list
When
I click on the
"Leave"
button for group
"Owned"
Then
I should see the
"Can not leave message"
@javascript
Scenario
:
Guest should be able to leave from group
Given
"Mary Jane"
is guest of group
"Guest"
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should see group
"Guest"
in group list
When
I click on the
"Leave"
button for group
"Guest"
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should not see group
"Guest"
in group list
@javascript
Scenario
:
Guest should be able to leave from group even if he is the only user in the group
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should see group
"Guest"
in group list
When
I click on the
"Leave"
button for group
"Guest"
When
I visit dashboard groups page
Then
I should see group
"Owned"
in group list
Then
I should not see group
"Guest"
in group list
Scenario
:
Create a group from dasboard
And
I visit dashboard groups page
And
I click new group link
And
submit form with new group
"Samurai"
info
Then
I should be redirected to group
"Samurai"
page
And
I should see newly created group
"Samurai"
features/steps/dashboard/group.rb
View file @
909a0ff3
...
...
@@ -4,44 +4,6 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
include
SharedPaths
include
SharedUser
# Leave
step
'I click on the "Leave" button for group "Owned"'
do
find
(
:css
,
'li'
,
text:
"Owner"
).
find
(
:css
,
'i.fa.fa-sign-out'
).
click
# poltergeist always confirms popups.
end
step
'I click on the "Leave" button for group "Guest"'
do
find
(
:css
,
'li'
,
text:
"Guest"
).
find
(
:css
,
'i.fa.fa-sign-out'
).
click
# poltergeist always confirms popups.
end
step
'I should not see the "Leave" button for group "Owned"'
do
expect
(
find
(
:css
,
'li'
,
text:
"Owner"
)).
not_to
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
# poltergeist always confirms popups.
end
step
'I should not see the "Leave" button for groupr "Guest"'
do
expect
(
find
(
:css
,
'li'
,
text:
"Guest"
)).
not_to
have_selector
(
:css
,
'i.fa.fa-sign-out'
)
# poltergeist always confirms popups.
end
step
'I should see group "Owned" in group list'
do
expect
(
page
).
to
have_content
(
"Owned"
)
end
step
'I should not see group "Owned" in group list'
do
expect
(
page
).
not_to
have_content
(
"Owned"
)
end
step
'I should see group "Guest" in group list'
do
expect
(
page
).
to
have_content
(
"Guest"
)
end
step
'I should not see group "Guest" in group list'
do
expect
(
page
).
not_to
have_content
(
"Guest"
)
end
step
'I click new group link'
do
click_link
"New Group"
end
...
...
@@ -60,8 +22,4 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
expect
(
page
).
to
have_content
"Samurai"
expect
(
page
).
to
have_content
"Tokugawa Shogunate"
end
step
'I should see the "Can not leave message"'
do
expect
(
page
).
to
have_content
"You can not leave the
\"
Owned
\"
group."
end
end
spec/controllers/groups/group_members_controller_spec.rb
View file @
909a0ff3
...
...
@@ -118,9 +118,7 @@ describe Groups::GroupMembersController do
it
'cannot removes himself from the group'
do
delete
:leave
,
group_id:
group
expect
(
response
).
to
redirect_to
(
group_path
(
group
))
expect
(
response
).
to
set_flash
[
:alert
].
to
"You can not leave the
\"
#{
group
.
name
}
\"
group. Transfer or delete the group."
expect
(
group
.
users
).
to
include
user
expect
(
response
.
status
).
to
eq
(
403
)
end
end
...
...
spec/controllers/projects/project_members_controller_spec.rb
View file @
909a0ff3
...
...
@@ -171,11 +171,7 @@ describe Projects::ProjectMembersController do
delete
:leave
,
namespace_id:
project
.
namespace
,
project_id:
project
expect
(
response
).
to
redirect_to
(
namespace_project_path
(
project
.
namespace
,
project
)
)
expect
(
response
).
to
set_flash
[
:alert
].
to
"You can not leave the
\"
#{
project
.
human_name
}
\"
project. Transfer or delete the project."
expect
(
project
.
users
).
to
include
user
expect
(
response
.
status
).
to
eq
(
403
)
end
end
...
...
spec/features/groups/members/member_leaves_group_spec.rb
View file @
909a0ff3
...
...
@@ -13,7 +13,6 @@ feature 'Groups > Members > Member leaves group', feature: true do
end
scenario
'user leaves group'
do
# find('#group-settings-button').click
click_link
'Leave Group'
expect
(
current_path
).
to
eq
(
dashboard_groups_path
)
...
...
spec/features/projects_spec.rb
View file @
909a0ff3
...
...
@@ -70,22 +70,6 @@ feature 'Project', feature: true do
end
end
describe
'leave project link'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
before
do
login_with
(
user
)
project
.
team
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
it
'click project-settings and find leave project'
do
find
(
'#project-settings-button'
).
click
expect
(
page
).
to
have_link
(
'Leave Project'
)
end
end
describe
'project title'
do
include
WaitForAjax
...
...
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