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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6ed73dc7
Commit
6ed73dc7
authored
Feb 03, 2017
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move dashboard issues spinach test to Rspec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
parent
57d5a549
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
112 deletions
+48
-112
features/dashboard/issues.feature
features/dashboard/issues.feature
+0
-21
features/steps/dashboard/issues.rb
features/steps/dashboard/issues.rb
+0
-91
spec/features/dashboard/issues_spec.rb
spec/features/dashboard/issues_spec.rb
+48
-0
No files found.
features/dashboard/issues.feature
deleted
100644 → 0
View file @
57d5a549
@dashboard
Feature
:
Dashboard Issues
Background
:
Given
I sign in as a user
And
I have authored issues
And
I have assigned issues
And
I have other issues
And
I visit dashboard issues page
Scenario
:
I
should see assigned issues
Then
I should see issues assigned to me
@javascript
Scenario
:
I
should see authored issues
When
I click
"Authored by me"
link
Then
I should see issues authored by me
@javascript
Scenario
:
I
should see all issues
When
I click
"All"
link
Then
I should see all issues
features/steps/dashboard/issues.rb
deleted
100644 → 0
View file @
57d5a549
class
Spinach::Features::DashboardIssues
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
Select2Helper
step
'I should see issues assigned to me'
do
should_see
(
assigned_issue
)
should_not_see
(
authored_issue
)
should_not_see
(
other_issue
)
end
step
'I should see issues authored by me'
do
should_see
(
authored_issue
)
should_see
(
authored_issue_on_public_project
)
should_not_see
(
assigned_issue
)
should_not_see
(
other_issue
)
end
step
'I should see all issues'
do
should_see
(
authored_issue
)
should_see
(
assigned_issue
)
should_see
(
other_issue
)
end
step
'I have authored issues'
do
authored_issue
authored_issue_on_public_project
end
step
'I have assigned issues'
do
assigned_issue
end
step
'I have other issues'
do
other_issue
end
step
'I click "Authored by me" link'
do
find
(
"#assignee_id"
).
set
(
""
)
find
(
".js-author-search"
,
match: :first
).
click
find
(
".dropdown-menu-author li a"
,
match: :first
,
text:
current_user
.
to_reference
).
click
end
step
'I click "All" link'
do
find
(
".js-author-search"
).
click
expect
(
page
).
to
have_selector
(
".dropdown-menu-author li a"
)
find
(
".dropdown-menu-author li a"
,
match: :first
).
click
expect
(
page
).
not_to
have_selector
(
".dropdown-menu-author li a"
)
find
(
".js-assignee-search"
).
click
expect
(
page
).
to
have_selector
(
".dropdown-menu-assignee li a"
)
find
(
".dropdown-menu-assignee li a"
,
match: :first
).
click
expect
(
page
).
not_to
have_selector
(
".dropdown-menu-assignee li a"
)
end
def
should_see
(
issue
)
expect
(
page
).
to
have_content
(
issue
.
title
[
0
..
10
])
end
def
should_not_see
(
issue
)
expect
(
page
).
not_to
have_content
(
issue
.
title
[
0
..
10
])
end
def
assigned_issue
@assigned_issue
||=
create
:issue
,
assignee:
current_user
,
project:
project
end
def
authored_issue
@authored_issue
||=
create
:issue
,
author:
current_user
,
project:
project
end
def
other_issue
@other_issue
||=
create
:issue
,
project:
project
end
def
authored_issue_on_public_project
@authored_issue_on_public_project
||=
create
:issue
,
author:
current_user
,
project:
public_project
end
def
project
@project
||=
begin
project
=
create
(
:empty_project
)
project
.
team
<<
[
current_user
,
:master
]
project
end
end
def
public_project
@public_project
||=
create
(
:empty_project
,
:public
)
end
end
spec/features/dashboard/issues_spec.rb
0 → 100644
View file @
6ed73dc7
require
'spec_helper'
RSpec
.
describe
'Dashboard Issues'
,
feature:
true
do
let
(
:current_user
)
{
create
:user
}
let
(
:public_project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:project
)
do
create
(
:empty_project
)
do
|
project
|
project
.
team
<<
[
current_user
,
:master
]
end
end
let!
(
:authored_issue
)
{
create
:issue
,
author:
current_user
,
project:
project
}
let!
(
:authored_issue_on_public_project
)
{
create
:issue
,
author:
current_user
,
project:
public_project
}
let!
(
:assigned_issue
)
{
create
:issue
,
assignee:
current_user
,
project:
project
}
let!
(
:other_issue
)
{
create
:issue
,
project:
project
}
before
do
login_as
(
current_user
)
visit
issues_dashboard_path
(
assignee_id:
current_user
.
id
)
end
it
'shows issues assigned to current user'
do
expect
(
page
).
to
have_content
(
assigned_issue
.
title
)
expect
(
page
).
not_to
have_content
(
authored_issue
.
title
)
expect
(
page
).
not_to
have_content
(
other_issue
.
title
)
end
it
'shows issues when current user is author'
,
js:
true
do
find
(
'#assignee_id'
,
visible:
false
).
set
(
''
)
find
(
'.js-author-search'
,
match: :first
).
click
find
(
'.dropdown-menu-author li a'
,
match: :first
,
text:
current_user
.
to_reference
).
click
expect
(
page
).
to
have_content
(
authored_issue
.
title
)
expect
(
page
).
to
have_content
(
authored_issue_on_public_project
.
title
)
expect
(
page
).
not_to
have_content
(
assigned_issue
.
title
)
expect
(
page
).
not_to
have_content
(
other_issue
.
title
)
end
it
'shows all issues'
do
click_link
(
'Reset filters'
)
expect
(
page
).
to
have_content
(
authored_issue
.
title
)
expect
(
page
).
to
have_content
(
authored_issue_on_public_project
.
title
)
expect
(
page
).
to
have_content
(
assigned_issue
.
title
)
expect
(
page
).
to
have_content
(
other_issue
.
title
)
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