Files
nairobi/spec/controllers/installation_controller_spec.rb
Javi Martín db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00

30 lines
801 B
Ruby

require "rails_helper"
describe InstallationController, type: :request do
describe "consul.json" do
let(:test_feature_settings) do
{
"disabled_feature" => nil,
"enabled_feature" => "t"
}
end
let(:seeds_feature_settings) { Setting.where("key LIKE 'feature.%'") }
before do
seeds_feature_settings.destroy_all
test_feature_settings.each do |feature_name, feature_value|
Setting["feature.#{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(JSON.parse(response.body)["release"]).not_to be_empty
expect(JSON.parse(response.body)["features"]).to eq(test_feature_settings)
end
end
end