|
|
|
|
@ -23,14 +23,14 @@ RSpec.describe TabNavHelper do
|
|
|
|
|
describe "#location_cell" do |
|
|
|
|
it "returns the location link to the postcode with optional name" do |
|
|
|
|
link = "/schemes/#{location.scheme.id}/locations/#{location.id}/edit" |
|
|
|
|
expected_html = "<a class=\"govuk-link\" rel=\"nofollow\" data-method=\"patch\" href=\"/schemes/#{scheme.id}/locations/#{location.id}/edit\">#{location.postcode}</a>\n<span class=\"govuk-visually-hidden\">Location </span><span class=\"govuk-!-font-weight-regular app-!-colour-muted\">#{location.name}</span>" |
|
|
|
|
expected_html = "<a class=\"govuk-link\" rel=\"nofollow\" data-method=\"patch\" href=\"/schemes/#{scheme.id}/locations/#{location.id}/edit\">#{location.postcode}</a>\n<span class=\"govuk-visually-hidden\">Location</span>" |
|
|
|
|
expect(location_cell_postcode(location, link)).to match(expected_html) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "#scheme_cell" do |
|
|
|
|
it "returns the scheme link service name and primary user group separated by a newline character" do |
|
|
|
|
expected_html = "<a class=\"govuk-link\" href=\"/schemes/#{scheme.id}\">#{scheme.service_name}</a>\n<span class=\"govuk-visually-hidden\">Scheme </span><span class=\"govuk-!-font-weight-regular app-!-colour-muted\">#{scheme.primary_client_group}</span>" |
|
|
|
|
expected_html = "<a class=\"govuk-link\" href=\"/schemes/#{scheme.id}\">#{scheme.service_name}</a>\n<span class=\"govuk-visually-hidden\">Scheme</span>" |
|
|
|
|
expect(scheme_cell(scheme)).to match(expected_html) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|