Fix broken spec

This commit is contained in:
Robin Ward 2015-11-20 14:27:30 -05:00
parent 8fdd6c18fc
commit e82145cbf9

View file

@ -29,8 +29,10 @@ class EmbedController < ApplicationController
@posts_left = @topic_view.topic.posts_count - SiteSetting.embed_post_limit - 1
end
@reply_count = @topic_view.topic.posts_count - 1
@reply_count = 0 if @reply_count < 0
if @topic_view
@reply_count = @topic_view.topic.posts_count - 1
@reply_count = 0 if @reply_count < 0
end
elsif embed_url.present?
Jobs.enqueue(:retrieve_topic, user_id: current_user.try(:id), embed_url: embed_url)