From 6537e7dc36515a4f7f2b404f6c5bd10594d7a7ed Mon Sep 17 00:00:00 2001 From: joshua stein Date: Mon, 9 May 2016 09:52:47 -0500 Subject: [PATCH] clean up tests --- spec/models/story_spec.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/models/story_spec.rb b/spec/models/story_spec.rb index b1eecc8..4063ca5 100644 --- a/spec/models/story_spec.rb +++ b/spec/models/story_spec.rb @@ -73,10 +73,16 @@ describe Story do it "converts a title to a url properly" do s = Story.make!(:title => "Hello there, this is a title") - s.title_as_url.should == "hello_there_this_is_a_title" + s.title_as_url.should == "hello_there_this_is_title" s = Story.make!(:title => "Hello _ underscore") s.title_as_url.should == "hello_underscore" + + s = Story.make!(:title => "Hello, underscore") + s.title_as_url.should == "hello_underscore" + + s = Story.make(:title => "The One-second War (What Time Will You Die?) ") + s.title_as_url.should == "one_second_war_what_time_will_you_die" end it "is not editable by another non-admin user" do @@ -101,11 +107,6 @@ describe Story do s.fetched_attributes[:title].should == "Google" end - it "has an underscored url from its title" do - s = Story.make(:title => "The One-second War (What Time Will You Die?) ") - s.title_as_url.should == "the_one-second_war_what_time_will_you_die" - end - it "sets the url properly" do s = Story.make(:title => "blah") s.url = "https://factorable.net/"