Added some functional tests (wiki).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@999 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-12-15 11:57:06 +00:00
parent 27d6334afa
commit 361c50c1f4
6 changed files with 191 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ class WikisControllerTest < Test::Unit::TestCase
User.current = nil
end
def test_create_wiki
def test_create
@request.session[:user_id] = 1
assert_nil Project.find(3).wiki
post :edit, :id => 3, :wiki => { :start_page => 'Start page' }
@@ -40,4 +40,17 @@ class WikisControllerTest < Test::Unit::TestCase
assert_not_nil wiki
assert_equal 'Start page', wiki.start_page
end
def test_destroy
@request.session[:user_id] = 1
post :destroy, :id => 1, :confirm => 1
assert_redirected_to 'projects/settings/1'
assert_nil Project.find(1).wiki
end
def test_not_found
@request.session[:user_id] = 1
post :destroy, :id => 999, :confirm => 1
assert_response 404
end
end