summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/messages_controller_test.rb6
-rw-r--r--test/functional/queries_controller_test.rb6
-rw-r--r--test/functional/workflows_controller_test.rb20
3 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb
index fa3af7917..f80d0ca78 100644
--- a/test/functional/messages_controller_test.rb
+++ b/test/functional/messages_controller_test.rb
@@ -81,6 +81,12 @@ class MessagesControllerTest < ActionController::TestCase
assert_template 'new'
end
+ def test_get_new_with_invalid_board
+ @request.session[:user_id] = 2
+ get :new, :board_id => 99
+ assert_response 404
+ end
+
def test_post_new
@request.session[:user_id] = 2
ActionMailer::Base.deliveries.clear
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb
index ba8ec13bc..5a49e56e3 100644
--- a/test/functional/queries_controller_test.rb
+++ b/test/functional/queries_controller_test.rb
@@ -24,6 +24,12 @@ class QueriesControllerTest < ActionController::TestCase
User.current = nil
end
+ def test_index
+ get :index
+ # HTML response not implemented
+ assert_response 406
+ end
+
def test_new_project_query
@request.session[:user_id] = 2
get :new, :project_id => 1
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index c4170ff52..af4ff6ef4 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -297,6 +297,26 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_equal source_t3, status_transitions(:tracker_id => 3, :role_id => 3)
end
+ def test_post_copy_with_incomplete_source_specification_should_fail
+ assert_no_difference 'WorkflowRule.count' do
+ post :copy,
+ :source_tracker_id => '', :source_role_id => '2',
+ :target_tracker_ids => ['2', '3'], :target_role_ids => ['1', '3']
+ assert_response 200
+ assert_select 'div.flash.error', :text => 'Please select a source tracker or role'
+ end
+ end
+
+ def test_post_copy_with_incomplete_target_specification_should_fail
+ assert_no_difference 'WorkflowRule.count' do
+ post :copy,
+ :source_tracker_id => '1', :source_role_id => '2',
+ :target_tracker_ids => ['2', '3']
+ assert_response 200
+ assert_select 'div.flash.error', :text => 'Please select target tracker(s) and role(s)'
+ end
+ end
+
# Returns an array of status transitions that can be compared
def status_transitions(conditions)
WorkflowTransition.