DEV: code cleanup (#37809)

- Removes double private keyword
- Fixes test mutating json as string, instead of json as hash. Calling
`string["description"] = ""` uses Ruby’s `String#[]=` method which finds
the substring `description` and replaces it with `""`, corrupting the
JSON but leaving it parseable with a `nil` description field instead of
`""`.
This commit is contained in:
Joffrey JAFFEUX
2026-02-13 11:55:53 +01:00
committed by GitHub
parent f837298d1f
commit df0cfc4dbe
2 changed files with 2 additions and 4 deletions
-2
View File
@@ -70,8 +70,6 @@ module Onebox
}
end
private
def load_repo
load_json("https://api.github.com/repos/#{match[:org]}/#{match[:repo]}")
end
@@ -46,9 +46,9 @@ RSpec.describe Onebox::Engine::GithubRepoOnebox do
context "when the repo has no description" do
let(:response) do
resp = onebox_response(described_class.onebox_name)
resp = MultiJson.load(onebox_response(described_class.onebox_name))
resp["description"] = ""
resp
MultiJson.dump(resp)
end
it "includes a message about contributing to the repo" do