Rubocop fixes (#3058)

This commit is contained in:
Anna Buianova 2019-06-06 16:48:14 +03:00 committed by Ben Halpern
parent 0ecb937875
commit 8b55d32640
7 changed files with 5 additions and 8 deletions

View file

@ -52,5 +52,4 @@ module ArticlesHelper
host.gsub!("medium.com", "Medium") if host.include?("medium.com")
host.start_with?("www.") ? host[4..-1] : host
end
end

View file

@ -33,4 +33,4 @@ class MediumTag < LiquidTagBase
end
end
Liquid::Template.register_tag("medium", MediumTag)
Liquid::Template.register_tag("medium", MediumTag)

View file

@ -62,7 +62,7 @@ class ChatChannelMembership < ApplicationRecord
def channel_color
if chat_channel.channel_type == "direct"
other_user&.decorate.darker_color
other_user&.decorate&.darker_color
else
"#111111"
end

View file

@ -311,13 +311,12 @@ RSpec.describe Article, type: :model do
expect(article.has_frontmatter?).to eq(true)
end
it "determines that an article has frontmatter" do
it "determines that an article doesn't have frontmatter" do
body = "Hey hey Ho Ho"
article.body_markdown = body
expect(article.has_frontmatter?).to eq(false)
end
it "returns stripped canonical url" do
article.canonical_url = " http://google.com "
expect(article.decorate.processed_canonical_url).to eq("http://google.com")

View file

@ -53,7 +53,7 @@ RSpec.describe "User visits articles by tag", type: :system do
end
context "when more articles" do
before do
it "visits ok" do
create_list(:article, 3, tags: "javascript", user: author, published_at: Time.current)
visit "/t/javascript"
end

View file

@ -4,7 +4,6 @@ RSpec.describe "User visits a homepage", type: :system do
let!(:article) { create(:article, reactions_count: 12, featured: true) }
let!(:article2) { create(:article, reactions_count: 20, featured: true) }
let!(:bad_article) { create(:article, reactions_count: 0) }
let!(:user) { create(:user) }
let!(:timestamp) { "2019-03-04T10:00:00Z" }
context "when no options specified" do

View file

@ -36,7 +36,7 @@ RSpec.describe "Organization index", type: :system do
end
context "when more articles" do
before do
it "visits ok" do
create_list(:article, 3, organization: organization)
visit "/#{organization.slug}"
end