Fix admin notification with relative URLs

The test was passing because it was using the rack driver, but on real
browsers it wasn't generating the expected URL.
This commit is contained in:
Javi Martín
2021-03-25 19:56:27 +01:00
parent f33d2cc3b1
commit d7563be8b3
3 changed files with 9 additions and 2 deletions

View File

@@ -43,6 +43,13 @@ describe AdminNotification do
expect(admin_notification.link).to eq("http://www.lol.consul.dev")
end
it "does not modify a relative link" do
admin_notification.link = "/proposals"
expect(admin_notification).to be_valid
expect(admin_notification.link).to eq("/proposals")
end
it "does not modify a link with http://" do
admin_notification.link = "http://lol.consul.dev"