Browse Source

failing test viewing logs for specific org as support user

pull/643/head
JG 3 years ago
parent
commit
4d4b9f17df
  1. 27
      spec/helpers/title_helper_spec.rb

27
spec/helpers/title_helper_spec.rb

@ -20,6 +20,7 @@ RSpec.describe TitleHelper do
let(:search_item) { nil }
let(:count) { 1 }
context "highest level links" do
context "organisation path" do
let(:path) { "/organisations" }
let(:page_title) { "Organisations" }
@ -86,5 +87,31 @@ RSpec.describe TitleHelper do
end
end
end
context "sub nav links" do
context "specific organisation logs path" do
let(:path) { "organisations/1/logs" }
let(:page_title) { "Logs" }
let(:organisation_name) { "Some Name" }
context "search is missing" do
let(:expected_title) { "#{organisation_name} (#{page_title})" }
it "returns expected title when no search" do
expect(format_title(path, nil, page_title, user, item_label, count)).to eq(expected_title)
end
end
context "search is present" do
let(:search_item) { "foobar" }
let(:expected_title) { "#{organisation_name} (#{count} #{item_label} matching ‘#{search_item}’)" }
it "returns expected title when search is present" do
expect(format_title(path, search_item, page_title, user, item_label, count)).to eq(expected_title)
end
end
end
end
end
end
end

Loading…
Cancel
Save