spec/support/shared.rb in permalink-1.1.2 vs spec/support/shared.rb in permalink-1.2.0
- old
+ new
@@ -59,11 +59,10 @@
it "should ignore blank attributes from to_param" do
model.permalink :title, :to_param => [:id, " ", nil, "\t", :permalink]
record = model.create(:title => "Some nice post")
- record.reload
record.to_param.should == "#{record.id}-some-nice-post"
end
it "should set permalink if permalink is blank" do
record = model.create(:title => "Some nice post", :permalink => " ")
@@ -81,7 +80,16 @@
record = model.create(:title => "Rails 3")
record.permalink.should == "rails-3"
record = model.create(:title => "Rails 3")
record.permalink.should == "rails-3-2"
+ end
+
+ it "should force permalink" do
+ model.permalink :title, :force => true
+
+ record = model.create(:title => "Some nice post")
+ record.update_attributes :title => "Awesome post"
+
+ record.permalink.should == "awesome-post"
end
end