Fix last_comment_at issue (#94)
* Fix last_comment_at issue * Fix classic article test
This commit is contained in:
parent
993002506f
commit
6938f3b78e
2 changed files with 1 additions and 8 deletions
|
|
@ -402,7 +402,7 @@ class Article < ApplicationRecord
|
|||
end
|
||||
|
||||
def set_last_comment_at
|
||||
self.last_comment_at = published_at.present? if published_at.present? && last_comment_at.blank?
|
||||
self.last_comment_at = published_at if published_at.present? && last_comment_at.blank?
|
||||
end
|
||||
|
||||
def title_to_slug
|
||||
|
|
|
|||
|
|
@ -19,13 +19,6 @@ RSpec.describe ClassicArticle do
|
|||
expect(described_class.new(user).get).to eq nil
|
||||
end
|
||||
|
||||
it "does not return article if user does not follow" do
|
||||
create(:reaction, user_id: user.id, reactable_id: article.id)
|
||||
create(:reaction, user_id: user.id, reactable_id: article.id, category:"thinking")
|
||||
create(:reaction, user_id: user.id, reactable_id: article.id, category:"unicorn")
|
||||
expect(described_class.new(user).get).to eq nil
|
||||
end
|
||||
|
||||
it "returns single article if multiple qualify" do
|
||||
user.follow(tag)
|
||||
create(:reaction, user_id: user.id, reactable_id: article.id)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue