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
b05ab108
Commit
b05ab108
authored
Feb 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec for task queue list page
parent
38026e5f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
0 deletions
+102
-0
features/dashboard/task_queue.feature
features/dashboard/task_queue.feature
+15
-0
features/steps/dashboard/task_queue.rb
features/steps/dashboard/task_queue.rb
+60
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-0
spec/factories/tasks.rb
spec/factories/tasks.rb
+23
-0
No files found.
features/dashboard/task_queue.feature
0 → 100644
View file @
b05ab108
@dashboard
Feature
:
Dashboard Task Queue
Background
:
Given
I sign in as a user
And
I own project
"Shop"
And
"John Doe"
is a developer of project
"Shop"
And
I have pending tasks
And
I visit dashboard task queue page
@javascript
Scenario
:
I
mark pending tasks as done
Then
I should see pending tasks assigned to me
And
I mark the pending task as done
And
I click on the
"Done"
tab
Then
I should see all tasks marked as done
features/steps/dashboard/task_queue.rb
0 → 100644
View file @
b05ab108
class
Spinach::Features::DashboardTaskQueue
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedProject
include
SharedUser
step
'"John Doe" is a developer of project "Shop"'
do
project
.
team
<<
[
john_doe
,
:developer
]
end
step
'I have pending tasks'
do
create
(
:task
,
user:
current_user
,
project:
project
,
author:
john_doe
,
target:
assigned_issue
,
action:
Task
::
ASSIGNED
)
end
step
'I should see pending tasks assigned to me'
do
expect
(
page
).
to
have_link
'Tasks (1)'
expect
(
page
).
to
have_link
'Done (0)'
page
.
within
(
'.tasks'
)
do
expect
(
page
).
to
have_content
project
.
name_with_namespace
expect
(
page
).
to
have_content
"John Doe assigned issue #
#{
assigned_issue
.
iid
}
"
expect
(
page
).
to
have_content
(
assigned_issue
.
title
[
0
..
10
])
expect
(
page
).
to
have_link
'Done'
end
end
step
'I mark the pending task as done'
do
click_link
'Done'
expect
(
page
).
to
have_content
'Task was successfully marked as done.'
expect
(
page
).
to
have_link
'Tasks (0)'
expect
(
page
).
to
have_link
'Done (1)'
expect
(
page
).
to
have_content
'No tasks to show'
end
step
'I click on the "Done" tab'
do
click_link
'Done (1)'
end
step
'I should see all tasks marked as done'
do
page
.
within
(
'.tasks'
)
do
expect
(
page
).
to
have_content
project
.
name_with_namespace
expect
(
page
).
to
have_content
"John Doe assigned issue #
#{
assigned_issue
.
iid
}
"
expect
(
page
).
to
have_content
(
assigned_issue
.
title
[
0
..
10
])
expect
(
page
).
not_to
have_link
'Done'
end
end
def
assigned_issue
@assigned_issue
||=
create
(
:issue
,
assignee:
current_user
,
project:
project
)
end
def
john_doe
@john_doe
||=
user_exists
(
"John Doe"
,
{
username:
"john_doe"
})
end
def
project
@project
||=
create
(
:project
,
name:
"Shop"
)
end
end
features/steps/shared/paths.rb
View file @
b05ab108
...
...
@@ -103,6 +103,10 @@ module SharedPaths
visit
dashboard_groups_path
end
step
'I visit dashboard task queue page'
do
visit
dashboard_tasks_path
end
step
'I should be redirected to the dashboard groups page'
do
expect
(
current_path
).
to
eq
dashboard_groups_path
end
...
...
spec/factories/tasks.rb
0 → 100644
View file @
b05ab108
# == Schema Information
#
# Table name: tasks
#
# id :integer not null, primary key
# user_id :integer not null
# project_id :integer not null
# target_id :integer not null
# target_type :string not null
# author_id :integer
# action :integer
# state :string not null
# created_at :datetime
# updated_at :datetime
#
FactoryGirl
.
define
do
factory
:task
do
project
author
user
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