Sha256: f7e761ad41f3a06fb90f62ab79fde9b773cdbdf399ca252ab94cc110cfd1af6e

Contents?: true

Size: 1.11 KB

Versions: 12

Compression:

Stored size: 1.11 KB

Contents

require File.dirname(__FILE__) + '/test_helper'
require 'action_controller/test_process'

class ExceptionNotifierTest < Test::Unit::TestCase
  
  def setup
    @controller = ActionController::Base.new
    @controller.request = ActionController::TestRequest.new
    @controller.response = ActionController::TestResponse.new
    @controller.params = {}
    @controller.send(:initialize_current_url)
    ActionController::Base.consider_all_requests_local = false
    @@delivered_mail = []
    ActionMailer::Base.class_eval do
      def deliver!(mail = @mail)
        @@delivered_mail << mail
      end
    end
  end

  def test_should_generate_message_without_controller
    begin
      raise 'problem'
    rescue RuntimeError => e
      assert_nothing_raised do
        ExceptionNotification::Notifier.deliver_exception_notification(e)
      end
    end
  end

  def test_should_generate_message_with_controller
    begin
      raise 'problem'
    rescue RuntimeError => e
      assert_nothing_raised do
        ExceptionNotification::Notifier.deliver_exception_notification(e, @controller, @controller.request)
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
super_exception_notifier-3.0.13 test/exception_notifier_test.rb
super_exception_notifier-3.0.12 test/exception_notifier_test.rb
super_exception_notifier-3.0.11 test/exception_notifier_test.rb
super_exception_notifier-3.0.10 test/exception_notifier_test.rb
super_exception_notifier-3.0.9 test/exception_notifier_test.rb
super_exception_notifier-3.0.8 test/exception_notifier_test.rb
super_exception_notifier-3.0.7 test/exception_notifier_test.rb
super_exception_notifier-3.0.6 test/exception_notifier_test.rb
super_exception_notifier-3.0.5 test/exception_notifier_test.rb
super_exception_notifier-3.0.4 test/exception_notifier_test.rb
super_exception_notifier-3.0.2 test/exception_notifier_test.rb
super_exception_notifier-3.0.1 test/exception_notifier_test.rb