Add a "Create New Page" Link to the Search Page
Based on an idea by nowa:
bcac6c9f94
This commit is contained in:
parent
664552ac02
commit
8cf26c9249
|
@ -35,4 +35,7 @@
|
||||||
expression. That's actually what Instiki uses, so go right ahead and flex your
|
expression. That's actually what Instiki uses, so go right ahead and flex your
|
||||||
"[a-z]*Leet?RegExpSkill(s|z)"
|
"[a-z]*Leet?RegExpSkill(s|z)"
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<b>Create a new page, named:</b> "<span class='newWikiWord'><%= link_to h(params[:query]), :web => @web.address, :action => 'new', :id => params[:query] %></span>"
|
||||||
|
</p>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
|
@ -782,11 +782,15 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_search_zero_results
|
def test_search_zero_results
|
||||||
r = process 'search', 'web' => 'wiki1', 'query' => 'non-existant text'
|
r = process 'search', 'web' => 'wiki1', 'query' => 'non-existant < text'
|
||||||
|
|
||||||
assert_response(:success)
|
assert_response(:success)
|
||||||
assert_equal [], r.template_objects['results']
|
assert_equal [], r.template_objects['results']
|
||||||
assert_equal [], r.template_objects['title_results']
|
assert_equal [], r.template_objects['title_results']
|
||||||
|
create_pattern = Regexp.new(Regexp.escape(%{<b>Create a new page, named:</b> \"}+
|
||||||
|
%{<span class='newWikiWord'><a href=\"/wiki1/new/non-existant+%3C+t}+
|
||||||
|
%{ext\">non-existant < text</a></span>}))
|
||||||
|
assert_match create_pattern, r.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_search_null_in_query
|
def test_search_null_in_query
|
||||||
|
|
Loading…
Reference in a new issue