summaryrefslogtreecommitdiffstats
path: root/test/functional/versions_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-13 18:52:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-13 18:52:09 +0000
commit48949f979a7d132ccbbc2239cd9e4ecf35fdeef5 (patch)
treedddfe3ebc99f33c4165665239fda38ab8a5a0d46 /test/functional/versions_controller_test.rb
parent86d756d22d6c191920970165d2dc40d1e823351d (diff)
downloadredmine-48949f979a7d132ccbbc2239cd9e4ecf35fdeef5.tar.gz
redmine-48949f979a7d132ccbbc2239cd9e4ecf35fdeef5.zip
Added some functional tests and a CVS test repository.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@987 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/versions_controller_test.rb')
-rw-r--r--test/functional/versions_controller_test.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index e8327938a..17ebd3518 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -39,4 +39,35 @@ class VersionsControllerTest < Test::Unit::TestCase
assert_tag :tag => 'h2', :content => /1.0/
end
+
+ def test_get_edit
+ @request.session[:user_id] = 2
+ get :edit, :id => 2
+ assert_response :success
+ assert_template 'edit'
+ end
+
+ def test_post_edit
+ @request.session[:user_id] = 2
+ post :edit, :id => 2,
+ :version => { :name => 'New version name',
+ :effective_date => Date.today.strftime("%Y-%m-%d")}
+ assert_redirected_to 'projects/settings/1'
+ version = Version.find(2)
+ assert_equal 'New version name', version.name
+ assert_equal Date.today, version.effective_date
+ end
+
+ def test_destroy
+ @request.session[:user_id] = 2
+ post :destroy, :id => 2
+ assert_redirected_to 'projects/settings/1'
+ assert_nil Version.find_by_id(2)
+ end
+
+ def test_issue_status_by
+ xhr :get, :status_by, :id => 2
+ assert_response :success
+ assert_template '_issue_counts'
+ end
end