summaryrefslogtreecommitdiffstats
path: root/test/functional/versions_controller_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-08-30 15:30:28 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-08-30 15:30:28 +0000
commita188abbe2813372d426afd2ab05841f0503f00c1 (patch)
tree6b5dc8168550f5b02a0a65d565c56bd1bae2f283 /test/functional/versions_controller_test.rb
parent1ebb0d9caec7cdc8d07c53d4d2fff416e41408aa (diff)
downloadredmine-a188abbe2813372d426afd2ab05841f0503f00c1.tar.gz
redmine-a188abbe2813372d426afd2ab05841f0503f00c1.zip
Refactor: move method, ProjectsController#roadmap to VersionsController#index.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4050 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/versions_controller_test.rb')
-rw-r--r--test/functional/versions_controller_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index e4864c908..5fcb1d05a 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -31,6 +31,39 @@ class VersionsControllerTest < ActionController::TestCase
User.current = nil
end
+ def test_index
+ get :index, :project_id => 1
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:versions)
+ # Version with no date set appears
+ assert assigns(:versions).include?(Version.find(3))
+ # Completed version doesn't appear
+ assert !assigns(:versions).include?(Version.find(1))
+ end
+
+ def test_index_with_completed_versions
+ get :index, :project_id => 1, :completed => 1
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:versions)
+ # Version with no date set appears
+ assert assigns(:versions).include?(Version.find(3))
+ # Completed version appears
+ assert assigns(:versions).include?(Version.find(1))
+ end
+
+ def test_index_showing_subprojects_versions
+ @subproject_version = Version.generate!(:project => Project.find(3))
+ get :index, :project_id => 1, :with_subprojects => 1
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:versions)
+
+ assert assigns(:versions).include?(Version.find(4)), "Shared version not found"
+ assert assigns(:versions).include?(@subproject_version), "Subproject version not found"
+ end
+
def test_show
get :show, :id => 2
assert_response :success