diff --git a/app/views/wiki/history.rhtml b/app/views/wiki/history.rhtml index c78ae115a..7ce78a0f2 100644 --- a/app/views/wiki/history.rhtml +++ b/app/views/wiki/history.rhtml @@ -30,6 +30,6 @@ <% end %> -<%= submit_tag l(:label_view_diff), :class => 'small' %> +<%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %> <%= pagination_links_full @version_pages, @version_count, :page_param => :p %> <% end %> diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index bbfdc8e7f..b5325357c 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -109,8 +109,18 @@ class WikiControllerTest < Test::Unit::TestCase assert_template 'history' assert_not_nil assigns(:versions) assert_equal 3, assigns(:versions).size + assert_select "input[type=submit][name=commit]" end - + + def test_history_with_one_version + get :history, :id => 1, :page => 'Another_page' + assert_response :success + assert_template 'history' + assert_not_nil assigns(:versions) + assert_equal 1, assigns(:versions).size + assert_select "input[type=submit][name=commit]", false + end + def test_diff get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1 assert_response :success