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
7a815d75
Commit
7a815d75
authored
Dec 24, 2017
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move explore groups spinach test to RSpec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
parent
228f42b5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
193 deletions
+87
-193
features/explore/groups.feature
features/explore/groups.feature
+0
-105
features/steps/explore/groups.rb
features/steps/explore/groups.rb
+0
-88
spec/features/explore/groups_spec.rb
spec/features/explore/groups_spec.rb
+87
-0
No files found.
features/explore/groups.feature
deleted
100644 → 0
View file @
228f42b5
@public
Feature
:
Explore Groups
Background
:
Given
group
"TestGroup"
has private project
"Enterprise"
@javascript
Scenario
:
I
should see group with private and internal projects as user
Given
group
"TestGroup"
has internal project
"Internal"
When
I sign in as a user
And
I visit group
"TestGroup"
page
Then
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group issues for internal project as user
Given
group
"TestGroup"
has internal project
"Internal"
When
I sign in as a user
And
I visit group
"TestGroup"
issues page
Then
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group merge requests for internal project as user
Given
group
"TestGroup"
has internal project
"Internal"
When
I sign in as a user
And
I visit group
"TestGroup"
merge requests page
Then
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group with private, internal and public projects as visitor
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I visit group
"TestGroup"
page
Then
I should see project
"Community"
items
And
I should not see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group issues for public project as visitor
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I visit group
"TestGroup"
issues page
Then
I should see project
"Community"
items
And
I should not see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group merge requests for public project as visitor
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I visit group
"TestGroup"
merge requests page
Then
I should see project
"Community"
items
And
I should not see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group with private, internal and public projects as user
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I sign in as a user
And
I visit group
"TestGroup"
page
Then
I should see project
"Community"
items
And
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group issues for internal and public projects as user
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I sign in as a user
And
I visit group
"TestGroup"
issues page
Then
I should see project
"Community"
items
And
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group merge requests for internal and public projects as user
Given
group
"TestGroup"
has internal project
"Internal"
Given
group
"TestGroup"
has public project
"Community"
When
I sign in as a user
And
I visit group
"TestGroup"
merge requests page
Then
I should see project
"Community"
items
And
I should see project
"Internal"
items
And
I should not see project
"Enterprise"
items
@javascript
Scenario
:
I
should see group with public project in public groups area
Given
group
"TestGroup"
has public project
"Community"
When
I visit the public groups area
Then
I should see group
"TestGroup"
@javascript
Scenario
:
I
should see group with public project in public groups area as user
Given
group
"TestGroup"
has public project
"Community"
When
I sign in as a user
And
I visit the public groups area
Then
I should see group
"TestGroup"
@javascript
Scenario
:
I
should see group with internal project in public groups area as user
Given
group
"TestGroup"
has internal project
"Internal"
When
I sign in as a user
And
I visit the public groups area
Then
I should see group
"TestGroup"
features/steps/explore/groups.rb
deleted
100644 → 0
View file @
228f42b5
class
Spinach::Features::ExploreGroups
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedGroup
include
SharedProject
step
'group "TestGroup" has private project "Enterprise"'
do
group_has_project
(
"TestGroup"
,
"Enterprise"
,
Gitlab
::
VisibilityLevel
::
PRIVATE
)
end
step
'group "TestGroup" has internal project "Internal"'
do
group_has_project
(
"TestGroup"
,
"Internal"
,
Gitlab
::
VisibilityLevel
::
INTERNAL
)
end
step
'group "TestGroup" has public project "Community"'
do
group_has_project
(
"TestGroup"
,
"Community"
,
Gitlab
::
VisibilityLevel
::
PUBLIC
)
end
step
'"John Doe" is owner of group "TestGroup"'
do
group
=
Group
.
find_by
(
name:
"TestGroup"
)
||
create
(
:group
,
name:
"TestGroup"
)
user
=
create
(
:user
,
name:
"John Doe"
)
group
.
add_owner
(
user
)
end
step
'I visit group "TestGroup" page'
do
visit
group_path
(
Group
.
find_by
(
name:
"TestGroup"
))
end
step
'I visit group "TestGroup" issues page'
do
visit
issues_group_path
(
Group
.
find_by
(
name:
"TestGroup"
))
end
step
'I visit group "TestGroup" merge requests page'
do
visit
merge_requests_group_path
(
Group
.
find_by
(
name:
"TestGroup"
))
end
step
'I visit group "TestGroup" members page'
do
visit
group_group_members_path
(
Group
.
find_by
(
name:
"TestGroup"
))
end
step
'I should not see project "Enterprise" items'
do
expect
(
page
).
not_to
have_content
"Enterprise"
end
step
'I should see project "Internal" items'
do
expect
(
page
).
to
have_content
"Internal"
end
step
'I should not see project "Internal" items'
do
expect
(
page
).
not_to
have_content
"Internal"
end
step
'I should see project "Community" items'
do
expect
(
page
).
to
have_content
"Community"
end
step
'I change filter to Everyone\'s'
do
click_link
"Everyone's"
end
step
'I should see group member "John Doe"'
do
expect
(
page
).
to
have_content
"John Doe"
end
protected
def
group_has_project
(
groupname
,
projectname
,
visibility_level
)
group
=
Group
.
find_by
(
name:
groupname
)
||
create
(
:group
,
name:
groupname
)
project
=
create
(
:project
,
namespace:
group
,
name:
projectname
,
path:
"
#{
groupname
}
-
#{
projectname
}
"
,
visibility_level:
visibility_level
)
create
(
:issue
,
title:
"
#{
projectname
}
feature"
,
project:
project
)
create
(
:merge_request
,
title:
"
#{
projectname
}
feature implemented"
,
source_project:
project
,
target_project:
project
)
create
(
:closed_issue_event
,
project:
project
)
end
end
spec/features/explore/groups_spec.rb
0 → 100644
View file @
7a815d75
require
'spec_helper'
describe
'Explore Groups'
,
:js
do
let
(
:user
)
{
create
:user
}
let
(
:group
)
{
create
:group
}
let!
(
:private_project
)
do
create
:project
,
:private
,
namespace:
group
do
|
project
|
create
(
:issue
,
project:
internal_project
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
end
end
let!
(
:internal_project
)
do
create
:project
,
:internal
,
namespace:
group
do
|
project
|
create
(
:issue
,
project:
project
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
end
end
let!
(
:public_project
)
do
create
(
:project
,
:public
,
namespace:
group
)
do
|
project
|
create
(
:issue
,
project:
project
)
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
end
end
shared_examples
'renders public and internal projects'
do
it
do
visit_page
expect
(
page
).
to
have_content
(
public_project
.
name
)
expect
(
page
).
to
have_content
(
internal_project
.
name
)
expect
(
page
).
not_to
have_content
(
private_project
.
name
)
end
end
shared_examples
'renders only public project'
do
it
do
visit_page
expect
(
page
).
to
have_content
(
public_project
.
name
)
expect
(
page
).
not_to
have_content
(
internal_project
.
name
)
expect
(
page
).
not_to
have_content
(
private_project
.
name
)
end
end
shared_examples
'renders group in public groups area'
do
it
do
visit
explore_groups_path
expect
(
page
).
to
have_content
(
group
.
name
)
end
end
context
'when signed in'
do
before
do
sign_in
(
user
)
end
it_behaves_like
'renders public and internal projects'
do
subject
(
:visit_page
)
{
visit
group_path
(
group
)
}
end
it_behaves_like
'renders public and internal projects'
do
subject
(
:visit_page
)
{
visit
issues_group_path
(
group
)
}
end
it_behaves_like
'renders public and internal projects'
do
subject
(
:visit_page
)
{
visit
merge_requests_group_path
(
group
)
}
end
it_behaves_like
'renders group in public groups area'
end
context
'when signed out'
do
it_behaves_like
'renders only public project'
do
subject
(
:visit_page
)
{
visit
group_path
(
group
)
}
end
it_behaves_like
'renders only public project'
do
subject
(
:visit_page
)
{
visit
issues_group_path
(
group
)
}
end
it_behaves_like
'renders only public project'
do
subject
(
:visit_page
)
{
visit
merge_requests_group_path
(
group
)
}
end
it_behaves_like
'renders group in public groups area'
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