Merged r4050 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4120 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -368,38 +368,6 @@ class ProjectsControllerTest < ActionController::TestCase
|
||||
:attributes => { :href => '/attachments/download/9/version_file.zip' }
|
||||
end
|
||||
|
||||
def test_roadmap
|
||||
get :roadmap, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'roadmap'
|
||||
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_roadmap_with_completed_versions
|
||||
get :roadmap, :id => 1, :completed => 1
|
||||
assert_response :success
|
||||
assert_template 'roadmap'
|
||||
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_roadmap_showing_subprojects_versions
|
||||
@subproject_version = Version.generate!(:project => Project.find(3))
|
||||
get :roadmap, :id => 1, :with_subprojects => 1
|
||||
assert_response :success
|
||||
assert_template 'roadmap'
|
||||
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_archive
|
||||
@request.session[:user_id] = 1 # admin
|
||||
post :archive, :id => 1
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -174,7 +174,7 @@ class RoutingTest < ActionController::IntegrationTest
|
||||
should_route :get, "/projects/567/destroy", :controller => 'projects', :action => 'destroy', :id => '567'
|
||||
should_route :get, "/projects/33/files", :controller => 'projects', :action => 'list_files', :id => '33'
|
||||
should_route :get, "/projects/33/files/new", :controller => 'projects', :action => 'add_file', :id => '33'
|
||||
should_route :get, "/projects/33/roadmap", :controller => 'projects', :action => 'roadmap', :id => '33'
|
||||
should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
|
||||
should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
|
||||
should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user