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
Léo-Paul Géneau
gitlab-ce
Commits
1108915f
Commit
1108915f
authored
May 06, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change wording for task list summaries
parent
0a99e6e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
app/models/concerns/taskable.rb
app/models/concerns/taskable.rb
+2
-2
spec/features/task_lists_spec.rb
spec/features/task_lists_spec.rb
+2
-2
spec/support/taskable_shared_examples.rb
spec/support/taskable_shared_examples.rb
+2
-2
No files found.
app/models/concerns/taskable.rb
View file @
1108915f
...
@@ -26,11 +26,11 @@ module Taskable
...
@@ -26,11 +26,11 @@ module Taskable
end
end
# Return a string that describes the current state of this Taskable's task
# Return a string that describes the current state of this Taskable's task
# list items, e.g. "20 tasks (12
done, 8 unfinished
)"
# list items, e.g. "20 tasks (12
completed, 8 remaining
)"
def
task_status
def
task_status
return
''
if
description
.
blank?
return
''
if
description
.
blank?
sum
=
tasks
.
summary
sum
=
tasks
.
summary
"
#{
sum
.
item_count
}
tasks (
#{
sum
.
complete_count
}
done,
#{
sum
.
incomplete_count
}
unfinished
)"
"
#{
sum
.
item_count
}
tasks (
#{
sum
.
complete_count
}
completed,
#{
sum
.
incomplete_count
}
remaining
)"
end
end
end
end
spec/features/task_lists_spec.rb
View file @
1108915f
...
@@ -69,7 +69,7 @@ feature 'Task Lists' do
...
@@ -69,7 +69,7 @@ feature 'Task Lists' do
it
'provides a summary on Issues#index'
do
it
'provides a summary on Issues#index'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_content
(
"6 tasks (2
done, 4 unfinished
)"
)
expect
(
page
).
to
have_content
(
"6 tasks (2
completed, 4 remaining
)"
)
end
end
end
end
...
@@ -145,7 +145,7 @@ feature 'Task Lists' do
...
@@ -145,7 +145,7 @@ feature 'Task Lists' do
it
'provides a summary on MergeRequests#index'
do
it
'provides a summary on MergeRequests#index'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
expect
(
page
).
to
have_content
(
"6 tasks (2
done, 4 unfinished
)"
)
expect
(
page
).
to
have_content
(
"6 tasks (2
completed, 4 remaining
)"
)
end
end
end
end
end
end
spec/support/taskable_shared_examples.rb
View file @
1108915f
...
@@ -15,8 +15,8 @@ shared_examples 'a Taskable' do
...
@@ -15,8 +15,8 @@ shared_examples 'a Taskable' do
it
'returns the correct task status'
do
it
'returns the correct task status'
do
expect
(
subject
.
task_status
).
to
match
(
'5 tasks'
)
expect
(
subject
.
task_status
).
to
match
(
'5 tasks'
)
expect
(
subject
.
task_status
).
to
match
(
'2
done
'
)
expect
(
subject
.
task_status
).
to
match
(
'2
completed
'
)
expect
(
subject
.
task_status
).
to
match
(
'3
unfinished
'
)
expect
(
subject
.
task_status
).
to
match
(
'3
remaining
'
)
end
end
describe
'#tasks?'
do
describe
'#tasks?'
do
...
...
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