This rule was introduced in rubocop-rails 2.18.0. Since using `response.parsed_body` is shorter than using `JSON.parse(response.body)`, this also means we can group some lines in one.
30 lines
791 B
Ruby
30 lines
791 B
Ruby
require "rails_helper"
|
|
|
|
describe InstallationController, type: :request do
|
|
describe "consul.json" do
|
|
let(:test_process_settings) do
|
|
{
|
|
"disabled_process" => nil,
|
|
"enabled_process" => "t"
|
|
}
|
|
end
|
|
|
|
let(:seeds_process_settings) { Setting.where("key LIKE 'process.%'") }
|
|
|
|
before do
|
|
seeds_process_settings.destroy_all
|
|
test_process_settings.each do |feature_name, feature_value|
|
|
Setting["process.#{feature_name}"] = feature_value
|
|
end
|
|
end
|
|
|
|
specify "with query string inside query params" do
|
|
get "/consul.json"
|
|
|
|
expect(response).to have_http_status(:ok)
|
|
expect(response.parsed_body["release"]).not_to be_empty
|
|
expect(response.parsed_body["features"]).to eq(test_process_settings)
|
|
end
|
|
end
|
|
end
|