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
Tatuya Kamada
gitlab-ce
Commits
31bc42de
Commit
31bc42de
authored
Oct 06, 2014
by
Vinnie Okada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Spinach tests for task lists
parent
3a3b2eb3
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
170 additions
and
0 deletions
+170
-0
features/project/issues/issues.feature
features/project/issues/issues.feature
+33
-0
features/project/merge_requests.feature
features/project/merge_requests.feature
+33
-0
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+26
-0
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+14
-0
features/steps/shared/markdown.rb
features/steps/shared/markdown.rb
+30
-0
features/steps/shared/note.rb
features/steps/shared/note.rb
+14
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+20
-0
No files found.
features/project/issues/issues.feature
View file @
31bc42de
...
...
@@ -126,3 +126,36 @@ Feature: Project Issues
When
I click label 'bug'
And
I should see
"Release 0.4"
in issues
And
I should not see
"Tweet control"
in issues
Scenario
:
Issue description should render task checkboxes
Given
project
"Shop"
has
"Tasks-open"
open issue with task markdown
When
I visit issue page
"Tasks-open"
Then
I should see task checkboxes in the description
@javascript
Scenario
:
Issue notes should not render task checkboxes
Given
project
"Shop"
has
"Tasks-open"
open issue with task markdown
When
I visit issue page
"Tasks-open"
And
I leave a comment with task markdown
Then
I should not see task checkboxes in the comment
# Task status in issues list
Scenario
:
Issues list should display task status
Given
project
"Shop"
has
"Tasks-open"
open issue with task markdown
When
I visit project
"Shop"
issues page
Then
I should see the task status for issue
"Tasks-open"
# Toggling task items
@javascript
Scenario
:
Task checkboxes should be enabled for an open issue
Given
project
"Shop"
has
"Tasks-open"
open issue with task markdown
When
I visit issue page
"Tasks-open"
Then
Task checkboxes should be enabled
@javascript
Scenario
:
Task checkboxes should be disabled for a closed issue
Given
project
"Shop"
has
"Tasks-closed"
closed issue with task markdown
When
I visit issue page
"Tasks-closed"
Then
Task checkboxes should be disabled
features/project/merge_requests.feature
View file @
31bc42de
...
...
@@ -96,6 +96,16 @@ Feature: Project Merge Requests
And
I leave a comment with a header containing
"Comment with a header"
Then
The comment with the header should not have an ID
Scenario
:
Merge request description should render task checkboxes
Given
project
"Shop"
has
"MR-task-open"
open MR with task markdown
When
I visit merge request page
"MR-task-open"
Then
I should see task checkboxes in the description
Scenario
:
Merge request notes should not render task checkboxes
Given
project
"Shop"
has
"MR-task-open"
open MR with task markdown
When
I visit merge request page
"MR-task-open"
Then
I should not see task checkboxes in the comment
# Toggling inline comments
@javascript
...
...
@@ -157,3 +167,26 @@ Feature: Project Merge Requests
And
I leave a comment like
"Line is wrong"
on line 39 of the second file
And
I click Side-by-side Diff tab
Then
I should see comments on the side-by-side diff page
# Task status in issues list
@now
Scenario
:
Merge requests list should display task status
Given
project
"Shop"
has
"MR-task-open"
open MR with task markdown
When
I visit project
"Shop"
merge requests page
Then
I should see the task status for merge request
"MR-task-open"
# Toggling task items
@javascript
Scenario
:
Task checkboxes should be enabled for an open merge request
Given
project
"Shop"
has
"MR-task-open"
open MR with task markdown
When
I visit merge request page
"MR-task-open"
Then
Task checkboxes should be enabled
@javascript
Scenario
:
Task checkboxes should be disabled for a closed merge request
Given
project
"Shop"
has
"MR-task-open"
open MR with task markdown
And
I visit merge request page
"MR-task-open"
And
I click link
"Close"
Then
Task checkboxes should be disabled
features/steps/project/issues/issues.rb
View file @
31bc42de
...
...
@@ -153,6 +153,32 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
author:
project
.
users
.
first
)
end
step
'project "Shop" has "Tasks-open" open issue with task markdown'
do
desc_text
=
<<
EOT
.
gsub
(
/^ {6}/
,
''
)
* [ ] Task 1
* [x] Task 2
EOT
create
(
:issue
,
title:
'Tasks-open'
,
project:
project
,
author:
project
.
users
.
first
,
description:
desc_text
)
end
step
'project "Shop" has "Tasks-closed" closed issue with task markdown'
do
desc_text
=
<<
EOT
.
gsub
(
/^ {6}/
,
''
)
* [ ] Task 1
* [x] Task 2
EOT
create
(
:closed_issue
,
title:
'Tasks-closed'
,
project:
project
,
author:
project
.
users
.
first
,
description:
desc_text
)
end
step
'empty project "Empty Project"'
do
create
:empty_project
,
name:
'Empty Project'
,
namespace:
@user
.
namespace
end
...
...
features/steps/project/merge_requests.rb
View file @
31bc42de
...
...
@@ -97,6 +97,20 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
author:
project
.
users
.
first
)
end
step
'project "Shop" has "MR-task-open" open MR with task markdown'
do
desc_text
=
<<
EOT
.
gsub
(
/^ {6}/
,
''
)
* [ ] Task 1
* [x] Task 2
EOT
create
(
:merge_request
,
title:
'MR-task-open'
,
source_project:
project
,
target_project:
project
,
author:
project
.
users
.
first
,
description:
desc_text
)
end
step
'I switch to the diff tab'
do
visit
diffs_project_merge_request_path
(
project
,
merge_request
)
end
...
...
features/steps/shared/markdown.rb
View file @
31bc42de
...
...
@@ -9,4 +9,34 @@ module SharedMarkdown
step
'Header "Description header" should have correct id and link'
do
header_should_have_correct_id_and_link
(
1
,
'Description header'
,
'description-header'
)
end
step
'I should see task checkboxes in the description'
do
expect
(
page
).
to
have_selector
(
'div.description li.task-list-item input[type="checkbox"]'
)
end
step
'I should see the task status for issue "Tasks-open"'
do
expect
(
find
(
:css
,
'span.task-status'
).
text
).
to
eq
(
'2 tasks (1 done, 1 unfinished)'
)
end
step
'I should see the task status for merge request "MR-task-open"'
do
expect
(
find
(
:css
,
'span.task-status'
).
text
).
to
eq
(
'2 tasks (1 done, 1 unfinished)'
)
end
step
'Task checkboxes should be enabled'
do
expect
(
page
).
to
have_selector
(
'div.description li.task-list-item input[type="checkbox"]:enabled'
)
end
step
'Task checkboxes should be disabled'
do
expect
(
page
).
to
have_selector
(
'div.description li.task-list-item input[type="checkbox"]:disabled'
)
end
end
features/steps/shared/note.rb
View file @
31bc42de
...
...
@@ -119,4 +119,18 @@ module SharedNote
page
.
should_not
have_css
(
"#comment-with-a-header"
)
end
end
step
'I leave a comment with task markdown'
do
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'* [x] Task item'
click_button
'Add Comment'
sleep
0.05
end
end
step
'I should not see task checkboxes in the comment'
do
expect
(
page
).
not_to
have_selector
(
'li.note div.timeline-content input[type="checkbox"]'
)
end
end
features/steps/shared/paths.rb
View file @
31bc42de
...
...
@@ -292,6 +292,16 @@ module SharedPaths
visit
project_issue_path
(
issue
.
project
,
issue
)
end
step
'I visit issue page "Tasks-open"'
do
issue
=
Issue
.
find_by
(
title:
'Tasks-open'
)
visit
project_issue_path
(
issue
.
project
,
issue
)
end
step
'I visit issue page "Tasks-closed"'
do
issue
=
Issue
.
find_by
(
title:
'Tasks-closed'
)
visit
project_issue_path
(
issue
.
project
,
issue
)
end
step
'I visit project "Shop" labels page'
do
project
=
Project
.
find_by
(
name:
'Shop'
)
visit
project_labels_path
(
project
)
...
...
@@ -322,6 +332,16 @@ module SharedPaths
visit
project_merge_request_path
(
mr
.
target_project
,
mr
)
end
step
'I visit merge request page "MR-task-open"'
do
mr
=
MergeRequest
.
find_by
(
title:
'MR-task-open'
)
visit
project_merge_request_path
(
mr
.
target_project
,
mr
)
end
step
'I visit merge request page "MR-task-closed"'
do
mr
=
MergeRequest
.
find_by
(
title:
'MR-task-closed'
)
visit
project_merge_request_path
(
mr
.
target_project
,
mr
)
end
step
'I visit project "Shop" merge requests page'
do
visit
project_merge_requests_path
(
project
)
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