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
Kazuhiko Shiozaki
gitlab-ce
Commits
42abdf69
Commit
42abdf69
authored
Oct 22, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More group tests with spinach
parent
83dc5f93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
4 deletions
+98
-4
features/admin/groups.feature
features/admin/groups.feature
+10
-0
features/group/group.feature
features/group/group.feature
+10
-0
features/steps/admin/admin_groups.rb
features/steps/admin/admin_groups.rb
+24
-0
features/steps/group/group.rb
features/steps/group/group.rb
+34
-4
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+20
-0
No files found.
features/admin/groups.feature
0 → 100644
View file @
42abdf69
Feature
:
Admin Groups
Background
:
Given
I sign in as an admin
And
I visit admin groups page
Scenario
:
Create a group
When
I click new group link
And
submit form with new group info
Then
I should be redirected to group page
And
I should see newly created group
features/group/group.feature
View file @
42abdf69
...
@@ -7,3 +7,13 @@ Feature: Groups
...
@@ -7,3 +7,13 @@ Feature: Groups
When
I visit group page
When
I visit group page
Then
I should see projects list
Then
I should see projects list
And
I should see projects activity feed
And
I should see projects activity feed
Scenario
:
I
should see group issues list
Given
project from group has issues assigned to me
When
I visit group issues page
Then
I should see issues from this group assigned to me
Scenario
:
I
should see group merge requests list
Given
project from group has merge requests assigned to me
When
I visit group merge requests page
Then
I should see merge requests from this group assigned to me
features/steps/admin/admin_groups.rb
0 → 100644
View file @
42abdf69
class
AdminGroups
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedActiveTab
When
'I click new group link'
do
click_link
"New Group"
end
And
'submit form with new group info'
do
fill_in
'group_name'
,
:with
=>
'gitlab'
fill_in
'group_code'
,
:with
=>
'gitlab'
click_button
"Save group"
end
Then
'I should see newly created group'
do
page
.
should
have_content
"Group: gitlab"
end
Then
'I should be redirected to group page'
do
current_path
.
should
==
admin_group_path
(
Group
.
last
)
end
end
features/steps/group/group.rb
View file @
42abdf69
...
@@ -2,10 +2,6 @@ class Groups < Spinach::FeatureSteps
...
@@ -2,10 +2,6 @@ class Groups < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedPaths
include
SharedPaths
When
'I visit group page'
do
visit
group_path
(
current_group
)
end
Then
'I should see projects list'
do
Then
'I should see projects list'
do
current_user
.
projects
.
each
do
|
project
|
current_user
.
projects
.
each
do
|
project
|
page
.
should
have_link
project
.
name
page
.
should
have_link
project
.
name
...
@@ -24,9 +20,43 @@ class Groups < Spinach::FeatureSteps
...
@@ -24,9 +20,43 @@ class Groups < Spinach::FeatureSteps
page
.
should
have_content
'closed issue'
page
.
should
have_content
'closed issue'
end
end
Then
'I should see issues from this group assigned to me'
do
assigned_to_me
(
:issues
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
end
end
Then
'I should see merge requests from this group assigned to me'
do
assigned_to_me
(
:merge_requests
).
each
do
|
issue
|
page
.
should
have_content
issue
.
title
end
end
Given
'project from group has issues assigned to me'
do
create
:issue
,
project:
project
,
assignee:
current_user
,
author:
current_user
end
Given
'project from group has merge requests assigned to me'
do
create
:merge_request
,
project:
project
,
assignee:
current_user
,
author:
current_user
end
protected
protected
def
current_group
def
current_group
@group
||=
Group
.
first
@group
||=
Group
.
first
end
end
def
project
current_group
.
projects
.
first
end
def
assigned_to_me
key
project
.
send
(
key
).
where
(
assignee_id:
current_user
.
id
)
end
end
end
features/steps/shared/paths.rb
View file @
42abdf69
...
@@ -5,6 +5,22 @@ module SharedPaths
...
@@ -5,6 +5,22 @@ module SharedPaths
visit
new_project_path
visit
new_project_path
end
end
# ----------------------------------------
# Group
# ----------------------------------------
When
'I visit group page'
do
visit
group_path
(
current_group
)
end
When
'I visit group issues page'
do
visit
issues_group_path
(
current_group
)
end
When
'I visit group merge requests page'
do
visit
merge_requests_group_path
(
current_group
)
end
# ----------------------------------------
# ----------------------------------------
# Dashboard
# Dashboard
# ----------------------------------------
# ----------------------------------------
...
@@ -85,6 +101,10 @@ module SharedPaths
...
@@ -85,6 +101,10 @@ module SharedPaths
visit
admin_resque_path
visit
admin_resque_path
end
end
And
'I visit admin groups page'
do
visit
admin_groups_path
end
# ----------------------------------------
# ----------------------------------------
# Generic Project
# Generic Project
# ----------------------------------------
# ----------------------------------------
...
...
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