mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
20 lines
663 B
Ruby
20 lines
663 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe GroupsHelper, type: :helper do
|
|
describe "ext_url" do
|
|
it "adds prefix if missing" do
|
|
expect(helper.ext_url("http://example.com/", "http://example.com/bla")).to eq("http://example.com/bla")
|
|
expect(helper.ext_url("http://example.com/", "bla")).to eq("http://example.com/bla")
|
|
end
|
|
end
|
|
describe "strip_url" do
|
|
it "removes http(s)://" do
|
|
expect(helper.strip_url("http://example.com/")).to eq("example.com/")
|
|
expect(helper.strip_url("https://example.com/")).to eq("example.com/")
|
|
expect(helper.strip_url("example.com")).to eq("example.com")
|
|
end
|
|
end
|
|
end
|