Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs committed May 9, 2016
1 parent d1c9aea commit 6537e7d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions spec/models/story_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@

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
Expand All @@ -101,11 +107,6 @@
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/"
Expand Down

0 comments on commit 6537e7d

Please sign in to comment.