From 597725d77ce07c1e297e83f2a3594bbe1902ab2e Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 8 Feb 2010 17:53:58 +0000 Subject: Separated ReportsController#issue_report into two separate actions. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3396 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/reports_controller_test.rb | 30 +++++++++++++++++++++++++----- test/integration/routing_test.rb | 2 +- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb index d9ef4942a..db9d9cda7 100644 --- a/test/functional/reports_controller_test.rb +++ b/test/functional/reports_controller_test.rb @@ -48,12 +48,32 @@ class ReportsControllerTest < ActionController::TestCase end end end - - def test_issue_report_details + + context "GET :issue_report_details" do %w(tracker version priority category assigned_to author subproject).each do |detail| - get :issue_report, :id => 1, :detail => detail - assert_response :success - assert_template 'issue_report_details' + context "for #{detail}" do + setup do + get :issue_report_details, :id => 1, :detail => detail + end + + should_respond_with :success + should_render_template :issue_report_details + should_assign_to :field + should_assign_to :rows + should_assign_to :data + should_assign_to :report_title + end end + + context "with an invalid detail" do + setup do + get :issue_report_details, :id => 1, :detail => 'invalid' + end + + should_respond_with :redirect + should_redirect_to('the issue report') {{:controller => 'reports', :action => 'issue_report', :id => 'ecookbook'}} + end + end + end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index dc3e32e8c..5f9b8c192 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -20,7 +20,7 @@ require "test_helper" class RoutingTest < ActionController::IntegrationTest context "issue reports" do should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' - should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report', :id => '567', :detail => 'assigned_to' + should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' end end -- cgit v1.2.3