summaryrefslogtreecommitdiffstats
path: root/test/functional/queries_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-19 20:06:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-19 20:06:01 +0000
commitbb5ccb870ce312cada7d8c95f1cba655cd9468ac (patch)
tree088f27f2fbce9bf65e6566f0d449eb14d3237c9b /test/functional/queries_controller_test.rb
parent34828e18161c9886f87ec17696b55f51983fac9b (diff)
downloadredmine-bb5ccb870ce312cada7d8c95f1cba655cd9468ac.tar.gz
redmine-bb5ccb870ce312cada7d8c95f1cba655cd9468ac.zip
Removes calls to #assert_template and #assigns in functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@15715 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/queries_controller_test.rb')
-rw-r--r--test/functional/queries_controller_test.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb
index 203ad2c23..4a8812777 100644
--- a/test/functional/queries_controller_test.rb
+++ b/test/functional/queries_controller_test.rb
@@ -34,7 +34,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :new, :project_id => 1
assert_response :success
- assert_template 'new'
+
assert_select 'input[name=?][value="0"][checked=checked]', 'query[visibility]'
assert_select 'input[name=query_is_for_all][type=checkbox]:not([checked]):not([disabled])'
assert_select 'select[name=?]', 'c[]' do
@@ -47,7 +47,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :new
assert_response :success
- assert_template 'new'
+
assert_select 'input[name=?]', 'query[visibility]', 0
assert_select 'input[name=query_is_for_all][type=checkbox][checked]:not([disabled])'
end
@@ -169,7 +169,7 @@ class QueriesControllerTest < Redmine::ControllerTest
post :create, :project_id => 'ecookbook', :query => {:name => ''}
end
assert_response :success
- assert_template 'new'
+
assert_select 'input[name=?]', 'query[name]'
end
@@ -294,7 +294,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :edit, :id => 4
assert_response :success
- assert_template 'edit'
+
assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]'
assert_select 'input[name=query_is_for_all][type=checkbox][checked=checked]'
end
@@ -303,7 +303,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 3
get :edit, :id => 3
assert_response :success
- assert_template 'edit'
+
assert_select 'input[name=?]', 'query[visibility]', 0
assert_select 'input[name=query_is_for_all][type=checkbox][checked=checked]'
end
@@ -312,7 +312,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 3
get :edit, :id => 2
assert_response :success
- assert_template 'edit'
+
assert_select 'input[name=?]', 'query[visibility]', 0
assert_select 'input[name=query_is_for_all][type=checkbox]:not([checked])'
end
@@ -321,7 +321,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :edit, :id => 1
assert_response :success
- assert_template 'edit'
+
assert_select 'input[name=?][value="2"][checked=checked]', 'query[visibility]'
assert_select 'input[name=query_is_for_all][type=checkbox]:not([checked])'
end
@@ -330,7 +330,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
get :edit, :id => 5
assert_response :success
- assert_template 'edit'
+
assert_select 'select[name=?]', 'query[sort_criteria][0][]' do
assert_select 'option[value=priority][selected=selected]'
assert_select 'option[value=desc][selected=selected]'
@@ -381,7 +381,7 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
put :update, :id => 4, :query => {:name => ''}
assert_response :success
- assert_template 'edit'
+ assert_select_error /Name cannot be blank/
end
def test_destroy
@@ -395,7 +395,6 @@ class QueriesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :new, :subject => 'foo/bar'
assert_response :success
- assert_template 'new'
assert_include 'addFilter("subject", "=", ["foo\/bar"]);', response.body
end
end