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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4c61c467
Commit
4c61c467
authored
Dec 24, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to Dashboard#merge_requests filter
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5953582b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
21 deletions
+76
-21
app/views/shared/_filter.html.haml
app/views/shared/_filter.html.haml
+2
-2
features/dashboard/merge_requests.feature
features/dashboard/merge_requests.feature
+12
-2
features/steps/dashboard/dashboard_merge_requests.rb
features/steps/dashboard/dashboard_merge_requests.rb
+62
-17
No files found.
app/views/shared/_filter.html.haml
View file @
4c61c467
=
form_tag
filter_path
(
entity
),
method:
'get'
do
=
form_tag
filter_path
(
entity
),
method:
'get'
do
%fieldset
%fieldset
.scope-filter
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
params
[
:scope
].
blank?
)}
%li
{
class:
(
"active"
if
params
[
:scope
].
blank?
)}
=
link_to
filter_path
(
entity
,
scope:
nil
)
do
=
link_to
filter_path
(
entity
,
scope:
nil
)
do
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
=
link_to
filter_path
(
entity
,
scope:
'all'
)
do
=
link_to
filter_path
(
entity
,
scope:
'all'
)
do
All
All
%fieldset
%fieldset
.status-filter
%ul
.nav.nav-pills.nav-stacked
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
params
[
:status
].
blank?
)}
%li
{
class:
(
"active"
if
params
[
:status
].
blank?
)}
=
link_to
filter_path
(
entity
,
status:
nil
)
do
=
link_to
filter_path
(
entity
,
status:
nil
)
do
...
...
features/dashboard/merge_requests.feature
View file @
4c61c467
...
@@ -2,7 +2,17 @@ Feature: Dashboard Merge Requests
...
@@ -2,7 +2,17 @@ Feature: Dashboard Merge Requests
Background
:
Background
:
Given
I sign in as a user
Given
I sign in as a user
And
I have authored merge requests
And
I have authored merge requests
And
I have assigned merge requests
And
I have other merge requests
And
I visit dashboard merge requests page
And
I visit dashboard merge requests page
Scenario
:
I
should see projects list
Scenario
:
I
should see assigned merge_requests
Then
I should see my merge requests
Then
I should see merge requests assigned to me
Scenario
:
I
should see authored merge_requests
When
I click
"Authored by me"
link
Then
I should see merge requests authored by me
Scenario
:
I
should see all merge_requests
When
I click
"All"
link
Then
I should see all merge requests
features/steps/dashboard/dashboard_merge_requests.rb
View file @
4c61c467
...
@@ -2,28 +2,73 @@ class DashboardMergeRequests < Spinach::FeatureSteps
...
@@ -2,28 +2,73 @@ class DashboardMergeRequests < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedPaths
include
SharedPaths
Then
'I should see my merge requests'
do
step
'I should see merge requests assigned to me'
do
merge_requests
=
@user
.
merge_requests
should_see
(
assigned_merge_request
)
merge_requests
.
each
do
|
mr
|
should_not_see
(
authored_merge_request
)
page
.
should
have_content
(
mr
.
title
[
0
..
10
])
should_not_see
(
other_merge_request
)
page
.
should
have_content
(
mr
.
target_project
.
name
)
end
page
.
should
have_content
(
mr
.
source_project
.
name
)
step
'I should see merge requests authored by me'
do
should_see
(
authored_merge_request
)
should_not_see
(
assigned_merge_request
)
should_not_see
(
other_merge_request
)
end
step
'I should see all merge requests'
do
should_see
(
authored_merge_request
)
should_see
(
assigned_merge_request
)
should_see
(
other_merge_request
)
end
step
'I have authored merge requests'
do
authored_merge_request
end
step
'I have assigned merge requests'
do
assigned_merge_request
end
step
'I have other merge requests'
do
other_merge_request
end
step
'I click "Authored by me" link'
do
within
".scope-filter"
do
click_link
'Authored by me'
end
end
step
'I click "All" link'
do
within
".scope-filter"
do
click_link
'All'
end
end
end
end
And
'I have authored merge requests'
do
def
should_see
(
merge_request
)
project1_source
=
create
:project
page
.
should
have_content
(
merge_request
.
title
[
0
..
10
])
project1_target
=
create
:project
end
project2_source
=
create
:project
project2_target
=
create
:project
def
should_not_see
(
merge_request
)
page
.
should_not
have_content
(
merge_request
.
title
[
0
..
10
])
end
project1_source
.
team
<<
[
@user
,
:master
]
def
assigned_merge_request
project1_target
.
team
<<
[
@user
,
:master
]
@assigned_merge_request
||=
create
:merge_request
,
assignee:
current_user
,
target_project:
project
project2_source
.
team
<<
[
@user
,
:master
]
end
project2_target
.
team
<<
[
@user
,
:master
]
def
authored_merge_request
@authored_merge_request
||=
create
:merge_request
,
author:
current_user
,
target_project:
project
end
def
other_merge_request
@other_merge_request
||=
create
:merge_request
,
target_project:
project
end
merge_request1
=
create
:merge_request
,
author:
@user
,
source_project:
project1_source
,
target_project:
project1_target
def
project
merge_request2
=
create
:merge_request
,
author:
@user
,
source_project:
project2_source
,
target_project:
project2_target
@project
||=
begin
project
=
create
:project_with_code
project
.
team
<<
[
current_user
,
:master
]
project
end
end
end
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