Additional specs for #1374

This commit is contained in:
erwanlr
2019-07-23 16:26:13 +01:00
parent 0e9eb34626
commit 4ce39951a9
3 changed files with 33 additions and 5 deletions

18
spec/lib/helper_spec.rb Normal file
View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
describe '#classify_slug' do
{
'slug' => :Slug,
'slug-usual' => :SlugUsual,
'12-slug' => :D_12Slug,
'slug.s' => :SlugS,
'slug yolo $' => :SlugYolo,
'slug $ ab.cd/12' => :SlugAbCd12
}.each do |slug, expected_symbol|
context "when #{slug}" do
it "returns #{expected_symbol}" do
expect(classify_slug(slug)).to eql expected_symbol
end
end
end
end