diff --git a/src/supermarket/app/helpers/custom_url_helper.rb b/src/supermarket/app/helpers/custom_url_helper.rb index c557efb7a..1d04cc9d3 100644 --- a/src/supermarket/app/helpers/custom_url_helper.rb +++ b/src/supermarket/app/helpers/custom_url_helper.rb @@ -9,6 +9,10 @@ def chef_domain ENV["CHEF_DOMAIN"] || "chef.io" end + def progress_domain + ENV["PROGRESS_DOMAIN"] || "progress.com" + end + def chef_server_url ENV["CHEF_SERVER_URL"] || "https://api.chef.io" end @@ -18,6 +22,11 @@ def chef_www_url(extra = nil) extra_dispatch(url, extra) end + def progress_www_url(extra = nil) + url = ENV["CHEF_WWW_URL"] || "https://www.#{progress_domain}" + extra_dispatch(url, extra) + end + def chef_blog_url(extra = nil) url = ENV["CHEF_BLOG_URL"] || "#{chef_www_url}/blog" extra_dispatch(url, extra) diff --git a/src/supermarket/app/views/layouts/application.html.erb b/src/supermarket/app/views/layouts/application.html.erb index 6654348be..41fe8276e 100644 --- a/src/supermarket/app/views/layouts/application.html.erb +++ b/src/supermarket/app/views/layouts/application.html.erb @@ -69,9 +69,9 @@ diff --git a/src/supermarket/spec/helpers/custom_url_helper_spec.rb b/src/supermarket/spec/helpers/custom_url_helper_spec.rb index 139c16054..f622c2939 100644 --- a/src/supermarket/spec/helpers/custom_url_helper_spec.rb +++ b/src/supermarket/spec/helpers/custom_url_helper_spec.rb @@ -14,6 +14,11 @@ expect(helper.chef_domain).to eql("chef.io") end + it "should have a default progress domain" do + expect(ENV["PROGRESS_DOMAIN"]).to be_nil + expect(helper.progress_domain).to eql("progress.com") + end + it "should have a server url" do expect(ENV["CHEF_SERVER_URL"]).to be_nil expect(helper.chef_server_url).to eql("https://api.chef.io")