Corrected a copy/paste bug in tests, and corresponding problems in rollback.rhtml

This commit is contained in:
Alexey Verkhovsky 2005-02-19 14:38:10 +00:00
parent 1fa143f5d4
commit beeed3eee6
3 changed files with 14 additions and 7 deletions

View file

@ -46,7 +46,7 @@
<% if @page.revisions.length > 1 %> <% if @page.revisions.length > 1 %>
| |
<%= link_to('Back in time', <%= link_to('Back in time',
{:web => @web.address, :action => 'edit', :id => @page.name, {:web => @web.address, :action => 'revision', :id => @page.name,
:rev => @page.revisions.length - 2}, :rev => @page.revisions.length - 2},
{:class => 'navlink', :accesskey => 'R'}) {:class => 'navlink', :accesskey => 'R'})
%> %>

View file

@ -6,17 +6,24 @@
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %> <%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
<form id="editForm" action="../save/<%= @page.url %>" method="post" onSubmit="cleanAuthorName();"> <%= form_tag({:web => @web.address, :action => 'save', :id => @page.name},
{:id => 'editForm', :method => 'post', :onSubmit => 'cleanAuthorName();'})
%>
<p> <p>
<textarea name="content" style="font-size: 12px; width: 450px; height: 500px"><%= @revision.content %></textarea> <textarea name="content" style="font-size: 12px; width: 450px; height: 500px"><%= @revision.content %></textarea>
</p> </p>
<p> <p>
<input type="submit" value="Update"> as <input type="submit" value="Update" accesskey="u" /> as
<input type="text" name="author" id="authorName" value="<%= @author %>" <input type="text" name="author" id="authorName" value="<%= @author %>"
onClick="this.value == 'AnonymousCoward' ? this.value = '' : true"> onClick="this.value == 'AnonymousCoward' ? this.value = '' : true" />
| <a href="../cancel_edit/<%= @page.url %>">Cancel</a> <small>(unlocks page)</small> |
<% link_to('Cancel',
{:web => @web.address, :action => 'cancel_edit', :id => @page.name},
{:accesskey => 'c'})
%>
<small>(unlocks page)</small>
</p> </p>
</form> <%= end_form_tag %>
<%= render("#{@web.markup}_help") if @web %> <%= render("#{@web.markup}_help") if @web %>

View file

@ -337,7 +337,7 @@ class WikiControllerTest < Test::Unit::TestCase
def test_rollback def test_rollback
# rollback shows a form where a revision can be edited. # rollback shows a form where a revision can be edited.
# its assigns the same as or revision # its assigns the same as or revision
r = process 'revision', 'web' => 'wiki1', 'id' => 'HomePage', 'rev' => '0' r = process 'rollback', 'web' => 'wiki1', 'id' => 'HomePage', 'rev' => '0'
assert_success assert_success
assert_equal @home, r.template_objects['page'] assert_equal @home, r.template_objects['page']