BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0b71dbcc
Commit
0b71dbcc
authored
Mar 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jej-backport-authorless-fix' into 'master'
Prevents error on nil author from Issuable author_name See merge request !10112
parents
a12c6db8
5b41b792
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
issuable.rb
app/models/concerns/issuable.rb
+1
-0
issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+28
-0
No files found.
app/models/concerns/issuable.rb
View file @
0b71dbcc
...
...
@@ -50,6 +50,7 @@ module Issuable
:email
,
:public_email
,
to: :author
,
allow_nil:
true
,
prefix:
true
delegate
:name
,
...
...
spec/models/concerns/issuable_spec.rb
View file @
0b71dbcc
...
...
@@ -44,6 +44,34 @@ describe Issue, "Issuable" do
it
{
expect
(
described_class
).
to
respond_to
(
:assigned
)
}
end
describe
'author_name'
do
it
'is delegated to author'
do
expect
(
issue
.
author_name
).
to
eq
issue
.
author
.
name
end
it
'returns nil when author is nil'
do
issue
.
author_id
=
nil
issue
.
save
(
validate:
false
)
expect
(
issue
.
author_name
).
to
eq
nil
end
end
describe
'assignee_name'
do
it
'is delegated to assignee'
do
issue
.
update!
(
assignee:
create
(
:user
))
expect
(
issue
.
assignee_name
).
to
eq
issue
.
assignee
.
name
end
it
'returns nil when assignee is nil'
do
issue
.
assignee_id
=
nil
issue
.
save
(
validate:
false
)
expect
(
issue
.
assignee_name
).
to
eq
nil
end
end
describe
"before_save"
do
describe
"#update_cache_counts"
do
context
"when previous assignee exists"
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