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
Boxiang Sun
gitlab-ce
Commits
b13a7344
Commit
b13a7344
authored
Feb 18, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pending examples from task model spec
parent
07eb334c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
spec/models/task_spec.rb
spec/models/task_spec.rb
+30
-4
No files found.
spec/models/task_spec.rb
View file @
b13a7344
...
...
@@ -46,8 +46,21 @@ describe Task, models: true do
end
describe
'#body?'
do
it
'returns true when target respond to title'
it
'returns false when target does not respond to title'
let
(
:issue
)
{
build
(
:issue
)
}
before
do
subject
.
target
=
issue
end
it
'returns true when target respond to title'
do
expect
(
subject
.
body?
).
to
eq
true
end
it
'returns false when target does not respond to title'
do
allow
(
issue
).
to
receive
(
:respond_to?
).
with
(
:title
).
and_return
(
false
)
expect
(
subject
.
body?
).
to
eq
false
end
end
describe
'#note_text'
do
...
...
@@ -65,7 +78,20 @@ describe Task, models: true do
end
describe
'#target_iid'
do
it
'returns target.iid when target respond to iid'
it
'returns target_id when target does not respond to iid'
let
(
:issue
)
{
build
(
:issue
,
id:
1
,
iid:
5
)
}
before
do
subject
.
target
=
issue
end
it
'returns target.iid when target respond to iid'
do
expect
(
subject
.
target_iid
).
to
eq
5
end
it
'returns target_id when target does not respond to iid'
do
allow
(
issue
).
to
receive
(
:respond_to?
).
with
(
:iid
).
and_return
(
false
)
expect
(
subject
.
target_iid
).
to
eq
1
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