From d485a85da02623116c7d1df241efd2f66a3a0620 Mon Sep 17 00:00:00 2001 From: Christian Rijke Date: Fri, 3 May 2013 16:26:31 +0200 Subject: [PATCH] Fix tests. --- test/functional/issues_controller_test.rb | 23 ++++++++++++++++++--- test/functional/journals_controller_test.rb | 19 ----------------- test/integration/routing_test.rb | 4 ++-- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index da50301da7..222c421c72 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1356,11 +1356,28 @@ class IssuesControllerTest < ActionController::TestCase end end - def test_reply_to_note + def test_quote_issue @request.session[:user_id] = 2 - get :edit, :id => 1, :journal_id => 1 + get :quoted, :id => 6 assert_response :success - assert_select_rjs :show, "update" + assert_template 'edit' + assert_not_nil assigns(:issue) + assert_equal Issue.find(6), assigns(:issue) + end + + def test_quote_issue_without_permission + @request.session[:user_id] = 7 + get :quoted, :id => 6 + assert_response 403 end + def test_quote_note + @request.session[:user_id] = 2 + get :quoted, :id => 6, :journal_id => 4 + assert_response :success + assert_template 'edit' + assert_not_nil assigns(:issue) + assert_equal Issue.find(6), assigns(:issue) + assert_equal Journal.find(4), assigns(:journal) + end end diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index 9bf5b1790b..057246fbbc 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -61,24 +61,5 @@ class JournalsControllerTest < ActionController::TestCase assert_equal 'application/atom+xml', @response.content_type end - def test_reply_to_issue - @request.session[:user_id] = 2 - get :new, :id => 6 - assert_response :success - assert_select_rjs :show, "update" - end - - def test_reply_to_issue_without_permission - @request.session[:user_id] = 7 - get :new, :id => 6 - assert_response 403 - end - - def test_reply_to_note - @request.session[:user_id] = 2 - get :new, :id => 6, :journal_id => 4 - assert_response :success - assert_select_rjs :show, "update" - end end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index 13ad1d3536..a47de4d70d 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -217,8 +217,8 @@ class RoutingTest < ActionDispatch::IntegrationTest should route(:post, "/issues/move").to( :controller => 'issues/moves', :action => 'create') - should route(:post, "/issues/1/quoted").to( :controller => 'journals', - :action => 'new', + should route(:get, "/issues/1/quoted").to( :controller => 'issues', + :action => 'quoted', :id => '1') should route(:get, "/issues/calendar").to( :controller => 'issues/calendars',