mirror of
https://github.com/discourse/discourse.git
synced 2026-07-31 16:48:26 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user