diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-18 21:26:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-18 21:26:30 +0000 |
commit | ec31b616982f137abdee8d0c6aa9dc4a6d103189 (patch) | |
tree | e4f5dc564be2b4ce5047a1f5acb2790fdc3b70ca /test/functional/gantts_controller_test.rb | |
parent | 1db54e228d98d20536133bf52a8af0ce67616dc3 (diff) | |
download | redmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.tar.gz redmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.zip |
Removes calls to #assert_template and #assigns in functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@15695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/gantts_controller_test.rb')
-rw-r--r-- | test/functional/gantts_controller_test.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb index ef38f53bc..abb9ca10b 100644 --- a/test/functional/gantts_controller_test.rb +++ b/test/functional/gantts_controller_test.rb @@ -32,8 +32,7 @@ class GanttsControllerTest < Redmine::ControllerTest i2.update_attribute(:due_date, 1.month.from_now) get :show, :project_id => 1 assert_response :success - assert_template 'gantts/show' - assert_not_nil assigns(:gantt) + # Issue with start and due dates i = Issue.find(1) assert_not_nil i.due_date @@ -46,21 +45,19 @@ class GanttsControllerTest < Redmine::ControllerTest def test_gantt_at_minimal_zoom get :show, :project_id => 1, :zoom => 1 assert_response :success - assert_equal 1, assigns(:gantt).zoom + assert_select 'input[type=hidden][name=zoom][value=?]', '1' end def test_gantt_at_maximal_zoom get :show, :project_id => 1, :zoom => 4 assert_response :success - assert_equal 4, assigns(:gantt).zoom + assert_select 'input[type=hidden][name=zoom][value=?]', '4' end def test_gantt_should_work_without_issue_due_dates Issue.update_all("due_date = NULL") get :show, :project_id => 1 assert_response :success - assert_template 'gantts/show' - assert_not_nil assigns(:gantt) end def test_gantt_should_work_without_issue_and_version_due_dates @@ -68,23 +65,17 @@ class GanttsControllerTest < Redmine::ControllerTest Version.update_all("effective_date = NULL") get :show, :project_id => 1 assert_response :success - assert_template 'gantts/show' - assert_not_nil assigns(:gantt) end def test_gantt_should_work_cross_project get :show assert_response :success - assert_template 'gantts/show' - assert_not_nil assigns(:gantt) - assert_not_nil assigns(:gantt).query - assert_nil assigns(:gantt).project end def test_gantt_should_not_disclose_private_projects get :show assert_response :success - assert_template 'gantts/show' + assert_select 'a', :text => /eCookbook/ # Root private project assert_select 'a', :text => /OnlineStore/, :count => 0 @@ -101,9 +92,6 @@ class GanttsControllerTest < Redmine::ControllerTest get :show assert_response :success - relations = assigns(:gantt).relations - assert_kind_of Hash, relations - assert relations.present? assert_select 'div.task_todo[id=?][data-rels*=?]', "task-todo-issue-#{issue1.id}", issue2.id.to_s assert_select 'div.task_todo[id=?]:not([data-rels])', "task-todo-issue-#{issue2.id}" end @@ -113,7 +101,6 @@ class GanttsControllerTest < Redmine::ControllerTest assert_response :success assert_equal 'application/pdf', @response.content_type assert @response.body.starts_with?('%PDF') - assert_not_nil assigns(:gantt) end def test_gantt_should_export_to_pdf_cross_project @@ -121,7 +108,6 @@ class GanttsControllerTest < Redmine::ControllerTest assert_response :success assert_equal 'application/pdf', @response.content_type assert @response.body.starts_with?('%PDF') - assert_not_nil assigns(:gantt) end if Object.const_defined?(:Magick) |