0
@@ -64,7 +64,6 @@ context "Dispatcher" do
0
assert_dispatch :error, sections(:home), '200', '9', '1', 'foo', %w(200 9 1 foo)
0
assert_dispatch :error, sections(:home), '2006', '239', '1', 'foo', %w(2006 239 1 foo)
0
assert_dispatch :error, sections(:home), '2006', '9', '123', 'foo', %w(2006 9 123 foo)
0
- assert_dispatch :error, sections(:home), '2006', '9', '1', 'a_b', %w(2006 9 1 a_b)
0
assert_dispatch :error, sections(:home), '2006', '9', '1', 'foo', 'boo', %w(2006 9 1 foo boo)
0
assert_dispatch :error, sections(:home), '2006', '9', '1', 'foo', 'comment', %w(2006 9 1 foo comment)
0
context "Dispatcher Permalink Recognition" do
0
-
specify "should recognize permalinks" do0
- options = {:year => '2006', :month => '9', :day => '1', :permalink => 'foo'}
0
- assert_equal [options, false, nil], Mephisto::Dispatcher.recognize_permalink(@site, %w(2006 9 1 foo))
0
+ specify "should recognize permalinks with default permalink style" do
0
+ options = {:year => '2006', :month => '9', :day => '1', :permalink => 'foo-bar_baz'}
0
+ assert_equal [options, false, nil], Mephisto::Dispatcher.recognize_permalink(@site, %w(2006 9 1 foo-bar_baz))
0
+ specify "should recognize permalinks with custom style" do
0
@site.permalink_style = 'entries/:id/:permalink'
0
@site.permalink_regex(true)
0
- options = {:id => '5', :permalink => 'foo-bar-baz'}
0
- assert_equal [options, false, nil], Mephisto::Dispatcher.recognize_permalink(@site, %w(entries 5 foo-bar-baz))
0
+ options = {:id => '5', :permalink => 'foo-bar_baz'}
0
+ assert_equal [options, false, nil], Mephisto::Dispatcher.recognize_permalink(@site, %w(entries 5 foo-bar_baz))
0
- specify "should recognize permalinks with comment" do
0
+ specify "should recognize permalinks with comment and default permalink style" do
0
options = {:year => '2006', :month => '9', :day => '1', :permalink => 'foo'}
0
assert_equal [options, true, nil], Mephisto::Dispatcher.recognize_permalink(@site, %w(2006 9 1 foo comments))
0
assert_equal [options, true, '5'], Mephisto::Dispatcher.recognize_permalink(@site, %w(2006 9 1 foo comments 5))
0
+ specify "should recognize permalinks with comment and custom style" do
0
@site.permalink_style = 'entries/:id/:permalink'
0
@site.permalink_regex(true)
0
options = {:id => '5', :permalink => 'foo-bar-baz'}
0
@@ -111,7 +114,6 @@ context "Dispatcher Permalink Recognition" do
0
assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(200 9 1 foo))
0
assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(2006 239 1 foo))
0
assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(2006 9 123 foo))
0
- assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(2006 9 1 a_b))
0
assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(2006 9 1 foo boo))
0
assert_nil Mephisto::Dispatcher.recognize_permalink(sites(:first), %w(2006 9 1 foo comment))
Comments
No one has commented yet.