From 44642d4d0c66dc5fffd4088b4730d1f216b292c7 Mon Sep 17 00:00:00 2001 From: Dan Neumann Date: Thu, 14 Feb 2013 16:46:11 -0600 Subject: [PATCH] slug should replace underscores --- lib/slug.rb | 2 +- spec/components/slug_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/slug.rb b/lib/slug.rb index 89e18a905..39afd86f6 100644 --- a/lib/slug.rb +++ b/lib/slug.rb @@ -6,7 +6,7 @@ module Slug def self.for(string) - string.parameterize + string.parameterize.gsub("_", "-") end end diff --git a/spec/components/slug_spec.rb b/spec/components/slug_spec.rb index 1ed7c4180..ec4509b10 100644 --- a/spec/components/slug_spec.rb +++ b/spec/components/slug_spec.rb @@ -39,5 +39,9 @@ describe Slug do Slug.for(from).should == to end + it 'replaces underscores' do + Slug.for("o_o_o").should == "o-o-o" + end + end