mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Add http to white label logo link if this do not start with http
This commit is contained in:
@@ -317,6 +317,14 @@ class Enterprise < ApplicationRecord
|
||||
)
|
||||
end
|
||||
|
||||
def white_label_logo_link
|
||||
return nil if self[:white_label_logo_link].blank?
|
||||
|
||||
return self[:white_label_logo_link] if self[:white_label_logo_link].start_with?('http')
|
||||
|
||||
"http://#{self[:white_label_logo_link]}"
|
||||
end
|
||||
|
||||
def website
|
||||
strip_url self[:website]
|
||||
end
|
||||
|
||||
@@ -710,6 +710,8 @@ describe '
|
||||
|
||||
context "can edit white label logo link" do
|
||||
it_behaves_like "edit link with", "https://www.openfoodnetwork.org", "https://www.openfoodnetwork.org"
|
||||
it_behaves_like "edit link with", "www.openfoodnetwork.org", "http://www.openfoodnetwork.org"
|
||||
it_behaves_like "edit link with", "openfoodnetwork.org", "http://openfoodnetwork.org"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user