Skip to content

Commit

Permalink
Merge pull request #4845 from consul/installation_processes
Browse files Browse the repository at this point in the history
Describe enabled processes in the consul.json URL
  • Loading branch information
javierm committed Jun 6, 2022
2 parents fb9b206 + 201e23d commit 9127e56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/installation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def consul_installation_details
end

def settings_feature_flags
Setting.where("key LIKE 'feature.%'").each_with_object({}) { |x, n| n[x.key.remove("feature.")] = x.value }
Setting.where("key LIKE 'process.%'").each_with_object({}) { |x, n| n[x.key.remove("process.")] = x.value }
end
end
16 changes: 8 additions & 8 deletions spec/controllers/installation_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

describe InstallationController, type: :request do
describe "consul.json" do
let(:test_feature_settings) do
let(:test_process_settings) do
{
"disabled_feature" => nil,
"enabled_feature" => "t"
"disabled_process" => nil,
"enabled_process" => "t"
}
end

let(:seeds_feature_settings) { Setting.where("key LIKE 'feature.%'") }
let(:seeds_process_settings) { Setting.where("key LIKE 'process.%'") }

before do
seeds_feature_settings.destroy_all
test_feature_settings.each do |feature_name, feature_value|
Setting["feature.#{feature_name}"] = feature_value
seeds_process_settings.destroy_all
test_process_settings.each do |feature_name, feature_value|
Setting["process.#{feature_name}"] = feature_value
end
end

Expand All @@ -23,7 +23,7 @@

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)
expect(JSON.parse(response.body)["features"]).to eq(test_process_settings)
end
end
end

0 comments on commit 9127e56

Please sign in to comment.