mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Merge pull request #130 from danneu/slug-refactoring
Lean on Inflector for slug transliteration.
This commit is contained in:
commit
6e74b4fb0c
2 changed files with 20 additions and 15 deletions
|
@ -1,12 +1,10 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
require 'slug'
|
||||
|
||||
describe Slug do
|
||||
|
||||
|
||||
it 'replaces spaces with hyphens' do
|
||||
Slug.for("hello world").should == 'hello-world'
|
||||
end
|
||||
|
@ -35,5 +33,11 @@ describe Slug do
|
|||
Slug.for("...hello").should == "hello"
|
||||
end
|
||||
|
||||
it 'handles our initial transliteration' do
|
||||
from = "àáäâčďèéëěêìíïîľĺňòóöôŕřšťůùúüûýžñç"
|
||||
to = "aaaacdeeeeeiiiillnoooorrstuuuuuyznc"
|
||||
Slug.for(from).should == to
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue