Files
openfoodnetwork/spec/services/url_generator_spec.rb
Maikel Linke dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00

20 lines
483 B
Ruby

# frozen_string_literal: true
RSpec.describe UrlGenerator do
subject { UrlGenerator }
describe "#to_url" do
it "converts to url-safe strings and removes unusable characters" do
expect(subject.to_url("Top Cat!?")).to eq "top-cat"
end
it "handles accents" do
expect(subject.to_url("Père Noël")).to eq "pere-noel"
end
it "handles transliteration of Chinese characters" do
expect(subject.to_url("你好")).to eq "ni-hao"
end
end
end