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
646aae3e
Commit
646aae3e
authored
Aug 21, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-fix-atom-feeds' into 'master'
Fix 500 errors in Atom feeds due to push events Closes #36705 See merge request !13695
parents
9316bb2b
4bfdf840
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
event.rb
app/models/event.rb
+10
-0
users_spec.rb
spec/features/atom/users_spec.rb
+6
-0
No files found.
app/models/event.rb
View file @
646aae3e
...
...
@@ -83,6 +83,10 @@ class Event < ActiveRecord::Base
self
.
inheritance_column
=
'action'
class
<<
self
def
model_name
ActiveModel
::
Name
.
new
(
self
,
nil
,
'event'
)
end
def
find_sti_class
(
action
)
if
action
.
to_i
==
PUSHED
PushEvent
...
...
@@ -438,6 +442,12 @@ class Event < ActiveRecord::Base
EventForMigration
.
create!
(
new_attributes
)
end
def
to_partial_path
# We are intentionally using `Event` rather than `self.class` so that
# subclasses also use the `Event` implementation.
Event
.
_to_partial_path
end
private
def
recent_update?
...
...
spec/features/atom/users_spec.rb
View file @
646aae3e
...
...
@@ -41,6 +41,8 @@ describe "User Feed" do
target_project:
project
,
description:
"Here is the fix: ![an image](image.png)"
)
end
let
(
:push_event
)
{
create
(
:push_event
,
project:
project
,
author:
user
)
}
let!
(
:push_event_payload
)
{
create
(
:push_event_payload
,
event:
push_event
)
}
before
do
project
.
team
<<
[
user
,
:master
]
...
...
@@ -70,6 +72,10 @@ describe "User Feed" do
it
'has XHTML summaries in merge request descriptions'
do
expect
(
body
).
to
match
/Here is the fix: <a[^>]*><img[^>]*\/><\/a>/
end
it
'has push event commit ID'
do
expect
(
body
).
to
have_content
(
Commit
.
truncate_sha
(
push_event
.
commit_id
))
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