Fix rubocop offenses (#1452)

This commit is contained in:
Arun Kumar 2019-01-03 09:23:38 -05:00 committed by Ben Halpern
parent dbf5fc63ad
commit 80a23ba403
4 changed files with 13 additions and 12 deletions

View file

@ -54,11 +54,11 @@ module Api
def create
@article = ArticleCreationService.new(@user, article_params, {}).create!
render json: if @article.persisted?
@article.to_json(only: [:id], methods: [:current_state_path])
else
@article.errors.to_json
end
render json: if @article.persisted?
@article.to_json(only: [:id], methods: [:current_state_path])
else
@article.errors.to_json
end
end
def update

View file

@ -72,10 +72,10 @@ module ApplicationHelper
def icon_url(name)
postfix = {
"twitter" => "v1456342401/twitter-logo-silhouette_1_letrqc.png",
"github" => "v1456342401/github-logo_m841aq.png",
"link" => "v1456342401/link-symbol_apfbll.png",
"volume" => "v1461589297/technology_1_aefet2.png",
"twitter" => "v1456342401/twitter-logo-silhouette_1_letrqc.png",
"github" => "v1456342401/github-logo_m841aq.png",
"link" => "v1456342401/link-symbol_apfbll.png",
"volume" => "v1461589297/technology_1_aefet2.png",
"volume-mute" => "v1461589297/technology_jiugwb.png"
}.fetch(name, "v1456342953/star-in-black-of-five-points-shape_sor40l.png")
@ -127,7 +127,7 @@ module ApplicationHelper
cl_image_path(src,
type: "fetch",
width: "1000",
width: "1000",
height: "500",
crop: "imagga_scale",
quality: "auto",

View file

@ -40,7 +40,8 @@ RSpec.describe "/internal/reactions", type: :request do
expect {
put "/internal/reactions/#{reaction.id}", params: {
reaction: { status: "confirmed" }
} }.to raise_error(Pundit::NotAuthorizedError)
}
}.to raise_error(Pundit::NotAuthorizedError)
end
end
end

View file

@ -38,7 +38,7 @@ module OmniauthMacros
uid: "1234567",
info: INFO,
extra: EXTRA_INFO,
credentials: CREDENTIAL
credentials: CREDENTIAL
}.freeze
def mock_auth_hash