mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
Initial release of Discourse
This commit is contained in:
32
spec/components/slug_spec.rb
Normal file
32
spec/components/slug_spec.rb
Normal file
@ -0,0 +1,32 @@
|
||||
# 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
|
||||
|
||||
it 'changes accented characters' do
|
||||
Slug.for('àllo').should == 'allo'
|
||||
end
|
||||
|
||||
it 'removes symbols' do
|
||||
Slug.for('evil#trout').should == 'eviltrout'
|
||||
end
|
||||
|
||||
it 'handles a.b.c properly' do
|
||||
Slug.for("a.b.c").should == "a-b-c"
|
||||
end
|
||||
|
||||
it 'handles double dots right' do
|
||||
Slug.for("a....b.....c").should == "a-b-c"
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user