mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 19:26:59 +02:00
Wiki page versions routes cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10687 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -64,6 +64,28 @@ class WikiControllerTest < ActionController::TestCase
|
||||
:alt => 'This is a logo' }
|
||||
end
|
||||
|
||||
def test_show_old_version
|
||||
get :show, :project_id => 'ecookbook', :id => 'CookBook_documentation', :version => '2'
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/1', :text => /Previous/
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/2/diff', :text => /diff/
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/3', :text => /Next/
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation', :text => /Current version/
|
||||
end
|
||||
|
||||
def test_show_first_version
|
||||
get :show, :project_id => 'ecookbook', :id => 'CookBook_documentation', :version => '1'
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
|
||||
assert_select 'a', :text => /Previous/, :count => 0
|
||||
assert_select 'a', :text => /diff/, :count => 0
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/2', :text => /Next/
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation', :text => /Current version/
|
||||
end
|
||||
|
||||
def test_show_redirected_page
|
||||
WikiRedirect.create!(:wiki_id => 1, :title => 'Old_title', :redirects_to => 'Another_page')
|
||||
|
||||
@@ -477,12 +499,17 @@ class WikiControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
def test_history
|
||||
get :history, :project_id => 1, :id => 'CookBook_documentation'
|
||||
get :history, :project_id => 'ecookbook', :id => 'CookBook_documentation'
|
||||
assert_response :success
|
||||
assert_template 'history'
|
||||
assert_not_nil assigns(:versions)
|
||||
assert_equal 3, assigns(:versions).size
|
||||
|
||||
assert_select "input[type=submit][name=commit]"
|
||||
assert_select 'td' do
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/2', :text => '2'
|
||||
assert_select 'a[href=?]', '/projects/ecookbook/wiki/CookBook_documentation/2/annotate'
|
||||
end
|
||||
end
|
||||
|
||||
def test_history_with_one_version
|
||||
|
||||
@@ -39,17 +39,12 @@ class RoutingWikiTest < ActionController::IntegrationTest
|
||||
:id => 'CookBook_documentation' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
|
||||
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2/diff" },
|
||||
{ :controller => 'wiki', :action => 'diff', :project_id => '1',
|
||||
:id => 'CookBook_documentation', :version => '2' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
|
||||
{ :controller => 'wiki', :action => 'diff', :project_id => '1',
|
||||
:id => 'CookBook_documentation', :version => '2', :version_from => '1' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
|
||||
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2/annotate" },
|
||||
{ :controller => 'wiki', :action => 'annotate', :project_id => '1',
|
||||
:id => 'CookBook_documentation', :version => '2' }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user