<%= yield %> diff --git a/config/locales/claims/en/models/hosting_environment.yml b/config/locales/claims/en/models/hosting_environment.yml new file mode 100644 index 0000000000..4aaa02ae6d --- /dev/null +++ b/config/locales/claims/en/models/hosting_environment.yml @@ -0,0 +1,7 @@ +en: + models: + hosting_environment: + claims: + name: beta + banner: + description: Make a complaint or give feedback diff --git a/config/locales/placements/en/models/hosting_environment.yml b/config/locales/placements/en/models/hosting_environment.yml new file mode 100644 index 0000000000..0ff5383669 --- /dev/null +++ b/config/locales/placements/en/models/hosting_environment.yml @@ -0,0 +1,7 @@ +en: + models: + hosting_environment: + placements: + name: beta + banner: + description: Make a complaint or give feedback diff --git a/spec/models/hosting_environment_spec.rb b/spec/models/hosting_environment_spec.rb new file mode 100644 index 0000000000..bd8c8490a9 --- /dev/null +++ b/spec/models/hosting_environment_spec.rb @@ -0,0 +1,40 @@ +require "rails_helper" + +RSpec.describe HostingEnvironment do + describe ".name" do + it "returns the name of the hosting environment" do + current_service = "claims" + expect(described_class.name(current_service)).to eq("test") + end + + context "when environment is production" do + it "returns the name of the hosting environment for claims" do + allow(Rails.env).to receive(:production?).and_return(true) + current_service = "claims" + expect(described_class.name(current_service)).to eq("beta") + end + + it "returns the name of the hosting environment for placements" do + allow(Rails.env).to receive(:production?).and_return(true) + current_service = "placements" + expect(described_class.name(current_service)).to eq("beta") + end + end + end + + describe ".banner_description" do + it "returns the banner description of the hosting environment for claims" do + current_service = "claims" + expect(described_class.banner_description(current_service)).to eq( + "Make a complaint or give feedback" + ) + end + + it "returns the banner description of the hosting environment for placements" do + current_service = "placements" + expect(described_class.banner_description(current_service)).to eq( + "Make a complaint or give feedback" + ) + end + end +end