summaryrefslogtreecommitdiffstats
path: root/test/functional/context_menus_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
commitec31b616982f137abdee8d0c6aa9dc4a6d103189 (patch)
treee4f5dc564be2b4ce5047a1f5acb2790fdc3b70ca /test/functional/context_menus_controller_test.rb
parent1db54e228d98d20536133bf52a8af0ce67616dc3 (diff)
downloadredmine-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/context_menus_controller_test.rb')
-rw-r--r--test/functional/context_menus_controller_test.rb23
1 files changed, 6 insertions, 17 deletions
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb
index c674e5d97..58ca8d094 100644
--- a/test/functional/context_menus_controller_test.rb
+++ b/test/functional/context_menus_controller_test.rb
@@ -37,7 +37,6 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :issues, :ids => [1]
assert_response :success
- assert_template 'context_menus/issues'
assert_select 'a.icon-edit[href=?]', '/issues/1/edit', :text => 'Edit'
assert_select 'a.icon-copy[href=?]', '/projects/ecookbook/issues/1/copy', :text => 'Copy'
@@ -59,7 +58,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
with_settings :default_language => 'en' do
get :issues, :ids => [1]
assert_response :success
- assert_template 'context_menus/issues'
+
assert_select 'a.icon-del.disabled[href="#"]', :text => 'Delete'
end
end
@@ -68,11 +67,8 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :issues, :ids => [1, 2]
assert_response :success
- assert_template 'context_menus/issues'
- assert_not_nil assigns(:issues)
- assert_equal [1, 2], assigns(:issues).map(&:id).sort
- ids = assigns(:issues).map(&:id).sort.map {|i| "ids%5B%5D=#{i}"}.join('&')
+ ids = [1, 2].map {|i| "ids%5B%5D=#{i}"}.join('&')
assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
assert_select 'a.icon-copy[href=?]', "/issues/bulk_edit?copy=1&#{ids}", :text => 'Copy'
@@ -87,11 +83,8 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :issues, :ids => [1, 2, 6]
assert_response :success
- assert_template 'context_menus/issues'
- assert_not_nil assigns(:issues)
- assert_equal [1, 2, 6], assigns(:issues).map(&:id).sort
- ids = assigns(:issues).map(&:id).sort.map {|i| "ids%5B%5D=#{i}"}.join('&')
+ ids = [1, 2, 6].map {|i| "ids%5B%5D=#{i}"}.join('&')
assert_select 'a.icon-edit[href=?]', "/issues/bulk_edit?#{ids}", :text => 'Edit'
assert_select 'a.icon-del[href=?]', "/issues?#{ids}", :text => 'Delete'
@@ -214,7 +207,6 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :issues, :ids => [1]
assert_response :success
- assert_template 'context_menus/issues'
assert_select 'a[href=?]', '/issues/bulk_update?ids%5B%5D=1&issue%5Bassigned_to_id%5D=2', :text => / me /
end
@@ -225,9 +217,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
get :issues, :ids => [1, 4]
assert_response :success
- assert_template 'context_menus/issues'
- assert_include version, assigns(:versions)
assert_select 'a', :text => 'eCookbook - Shared'
end
@@ -245,7 +235,6 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :time_entries, :ids => [1, 2]
assert_response :success
- assert_template 'context_menus/time_entries'
assert_select 'a:not(.disabled)', :text => 'Edit'
end
@@ -254,7 +243,6 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :time_entries, :ids => [1]
assert_response :success
- assert_template 'context_menus/time_entries'
assert_select 'a:not(.disabled)', :text => 'Edit'
end
@@ -265,6 +253,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :time_entries, :ids => [1, 2]
assert_response :success
+
assert_select "li.cf_#{field.id}" do
assert_select 'a[href="#"]', :text => "Field"
assert_select 'ul' do
@@ -284,7 +273,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
get :time_entries, :ids => ids
assert_response :success
- assert_template 'context_menus/time_entries'
+
assert_select 'a:not(.disabled)', :text => 'Edit'
end
@@ -294,7 +283,7 @@ class ContextMenusControllerTest < Redmine::ControllerTest
get :time_entries, :ids => [1, 2]
assert_response :success
- assert_template 'context_menus/time_entries'
+
assert_select 'a.disabled', :text => 'Edit'
end
end