|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
require "rails_helper" |
|
|
|
|
|
|
|
|
|
using RefinementTest |
|
|
|
|
|
|
|
|
|
RSpec.describe TabNavHelper do |
|
|
|
|
let(:organisation) { FactoryBot.create(:organisation) } |
|
|
|
|
let(:user) { FactoryBot.build(:user, organisation:) } |
|
|
|
@ -23,7 +25,7 @@ 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.formatted_postcode}</a>\n<span class=\"govuk-visually-hidden\">Location </span><span class=\"govuk-!-font-weight-regular app-!-colour-muted\">#{location.name}</span>" |
|
|
|
|
expect(location_cell(location, link)).to match(expected_html) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|