From dafe67046a4839fe65b2f88d4cad2934884c33bb Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Thu, 27 May 2010 01:17:24 -0500 Subject: [PATCH] Better Use :only_path => true --- lib/chunks/category.rb | 2 +- test/test_helper.rb | 2 +- test/unit/chunks/category_test.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/chunks/category.rb b/lib/chunks/category.rb index 351ac51d..ddc05f99 100644 --- a/lib/chunks/category.rb +++ b/lib/chunks/category.rb @@ -33,6 +33,6 @@ def initialize(match_data, content) # TODO move presentation of page metadata to controller/view def url(category) %{#{category}} + :action => 'list', :only_path => true}/#{CGI.escape(category)}">#{category}} end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 17f5e5ef..77be2e46 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -123,7 +123,7 @@ class StubUrlGenerator < AbstractUrlGenerator def url_for(hash = {}) if(hash[:action] == 'list') - "http://example.com/#{hash[:web]}/list" + "/#{hash[:web]}/list" else '../files/pngs' end diff --git a/test/unit/chunks/category_test.rb b/test/unit/chunks/category_test.rb index 3997a37b..923a4a16 100755 --- a/test/unit/chunks/category_test.rb +++ b/test/unit/chunks/category_test.rb @@ -8,9 +8,9 @@ class CategoryTest < Test::Unit::TestCase def test_single_category match(Category, 'category: test', :list => ['test'], :hidden => nil, :unmask_text => - "
category: test
") + "
category: test
") match(Category, 'category : chunk test ', :list => ['chunk test'], :hidden => nil, :unmask_text => - "
category: chunk test
") + "
category: chunk test
") match(Category, ':category: test', :list => ['test'], :hidden => ':') end