Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasfed committed Oct 23, 2023
1 parent 44c5d67 commit 379be81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/deprecation_collector/web/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def detect_tag(deprecation)
msg = deprecation[:message].to_s
return :kwargs if msg.include?("Using the last argument as keyword parameters is deprecated") ||
msg.include?("Passing the keyword argument as the last hash parameter is deprecated")

nil
end

def test_deprecation?(deprecation)
Expand Down
2 changes: 2 additions & 0 deletions lib/deprecation_collector/web/router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def render(plain: nil, html: nil, json: nil, erb: nil, slim: nil, # rubocop:disa
}

return [status, { "content-type" => "text/html" }.merge(color_scheme_headers), [html.to_s]] if html

nil
end

VIEW_PATH = "#{__dir__}/views"
Expand Down
6 changes: 2 additions & 4 deletions spec/deprecation_collector/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@

context "when disabled" do
it "shows enable" do
allow(collector.storage).to receive(:support_disabling?).and_return(true)
allow(collector.storage).to receive(:enabled?).and_return(false)
allow(collector.storage).to receive_messages(support_disabling?: true, enabled?: false)
get "/"
expect(last_response.body).to include("/enable")
end

it "shows disable" do
allow(collector.storage).to receive(:support_disabling?).and_return(true)
allow(collector.storage).to receive(:enabled?).and_return(true)
allow(collector.storage).to receive_messages(support_disabling?: true, enabled?: true)
get "/"
expect(last_response.body).to include("/disable")
expect(last_response.body).not_to include("/enable")
Expand Down

0 comments on commit 379be81

Please sign in to comment.