|
|
|
@ -7,6 +7,33 @@ RSpec.describe ApplicationHelper do
|
|
|
|
|
let(:case_log) { FactoryBot.build(:case_log, :in_progress) } |
|
|
|
|
let(:pagy) { nil } |
|
|
|
|
|
|
|
|
|
describe "govuk_header_classes" do |
|
|
|
|
context "with external user" do |
|
|
|
|
expect(govuk_header_classes) .to eq("app-header") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with internal support user" do |
|
|
|
|
let(:current_user) { FactoryBot.create(:user, :support) } |
|
|
|
|
expect(govuk_header_classes) .to eq("app-header app-header--orange") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "govuk_phase_banner_tag" do |
|
|
|
|
context "with external user" do |
|
|
|
|
expect(govuk_phase_banner_tag) .to eq({ |
|
|
|
|
text: "Beta", |
|
|
|
|
}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with support user" do |
|
|
|
|
let(:current_user) { FactoryBot.create(:user, :support) } |
|
|
|
|
expect(govuk_phase_banner_tag) .to eq({ |
|
|
|
|
colour: "orange", |
|
|
|
|
text: "Support beta", |
|
|
|
|
}) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "browser_title" do |
|
|
|
|
context "with no pagination" do |
|
|
|
|
it "returns correct browser title when title is given" do |
|
|
|
|