From 9b857d3501498092327b2c8119d91aec1d9408a2 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 12 Jun 2009 19:47:56 -0500 Subject: [PATCH] Test page_name, not text Fix from Jason Blevins. --- lib/url_generator.rb | 2 +- test/test_helper.rb | 2 +- test/unit/page_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/url_generator.rb b/lib/url_generator.rb index d574f7f4..760070d7 100644 --- a/lib/url_generator.rb +++ b/lib/url_generator.rb @@ -87,7 +87,7 @@ class UrlGenerator < AbstractUrlGenerator end def page_link(mode, name, text, web_address, known_page) - return %{Illegal link (contains a '.'): [[#{text}]]} if text.include?('.') + return %{Illegal link (target contains a '.'): #{name}} if name.include?('.') case mode when :export if known_page diff --git a/test/test_helper.rb b/test/test_helper.rb index 76302762..0f6832e1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -127,7 +127,7 @@ class StubUrlGenerator < AbstractUrlGenerator def page_link(mode, name, text, web_address, known_page) link = CGI.escape(name) - return %{Illegal link (contains a '.'): [[#{text}]]} if text.include?('.') + return %{Illegal link (target contains a '.'): #{name}} if name.include?('.') case mode when :export if known_page then %{#{text}} diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb index 3011e21f..395d4466 100644 --- a/test/unit/page_test.rb +++ b/test/unit/page_test.rb @@ -161,7 +161,7 @@ class PageTest < ActiveSupport::TestCase references = new_page.wiki_references(true) assert_equal( "

Reference to Happy Page" + " and to Wanted Page2?.pdf " + - "and Illegal link (contains a '.'): [[foo.pdf]]

", + "and Illegal link (target contains a '.'): foo.pdf

", test_renderer(new_page.revisions.last).display_content(true) ) assert_equal 3, references.size # now it works.