From 61fdd384350b04bb399a41f93d35b88be23e0c97 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Wed, 15 Sep 2010 17:50:20 +0200 Subject: [PATCH] move issue journal reply to issue controller test, as each journalized controller will now use the render_reply journals helper to reply --- app/models/issue.rb | 2 +- test/functional/issues_controller_test.rb | 8 ++++++++ test/functional/journals_controller_test.rb | 14 -------------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 60737fbb13..8dda019606 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -36,7 +36,7 @@ class Issue < ActiveRecord::Base acts_as_customizable acts_as_watchable - acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.journaled.id} (#{o.status}): #{o.subject}"}, + acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.journaled_id} (#{o.status}): #{o.subject}"}, :event_type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') } register_on_journal_formatter(:id, 'parent_id') diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index f32e70e9ab..cf3c34266f 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1077,4 +1077,12 @@ class IssuesControllerTest < ActionController::TestCase :child => {:tag => 'form', :child => {:tag => 'input', :attributes => {:name => 'issues', :type => 'hidden', :value => '1'}}} end + + def test_reply_to_note + @request.session[:user_id] = 2 + get :edit, :id => 1, :journal_id => 1 + assert_response :success + assert_select_rjs :show, "update" + end + end diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index f8fc7f461d..d279d7e31e 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -30,20 +30,6 @@ class JournalsControllerTest < ActionController::TestCase @response = ActionController::TestResponse.new User.current = nil end - - def test_reply_to_issue - @request.session[:user_id] = 2 - get :new, :id => 1 - assert_response :success - assert_select_rjs :show, "update" - end - - def test_reply_to_note - @request.session[:user_id] = 2 - get :new, :id => 1, :journal_id => 2 - assert_response :success - assert_select_rjs :show, "update" - end def test_get_edit @request.session[:user_id] = 1