Add new param to partial '_setting_table'

When we reuse the partial '_setting_table' to render the 3 types
of remote census settings, we need customize setting_name key by
default to clarify the information to render.

- Add new param 'setting_name' to partial '_setting_table'
- Create new setting helper method to use new setting_name param
  to display a more clarify setting name on table.
This commit is contained in:
taitus
2019-04-10 14:26:38 +02:00
committed by Javi Martín
parent 0a901cb82f
commit 12b6b1df05
7 changed files with 31 additions and 5 deletions

View File

@@ -28,4 +28,13 @@ RSpec.describe SettingsHelper, type: :helper do
end
end
end
describe "#display_setting_name" do
it "returns correct setting_name" do
expect(display_setting_name("setting")).to eq("Setting")
expect(display_setting_name("remote_census_general_name")).to eq("General Information")
expect(display_setting_name("remote_census_request_name")).to eq("Request Data")
expect(display_setting_name("remote_census_response_name")).to eq("Response Data")
end
end
end