Hello community,

here is the log from the commit of package rubygem-exception_notification for 
openSUSE:Factory checked in at 2016-07-30 00:27:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-exception_notification (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-exception_notification.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-exception_notification"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-exception_notification/rubygem-exception_notification.changes
    2016-07-20 09:25:19.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-exception_notification.new/rubygem-exception_notification.changes
       2016-07-30 00:27:30.000000000 +0200
@@ -1,0 +2,16 @@
+Tue Jul 19 04:28:54 UTC 2016 - [email protected]
+
+- updated to version 4.2.1
+ see installed CHANGELOG.rdoc
+
+  == 4.2.1
+  
+  * enhancements
+    * Allow customizable backtrace for Slack (by @aried3r)
+    * Add `Mongoid::Errors::DocumentNotFound` to ignored_exceptions (by 
@nazarok)
+    * Improved text in Slack notifier (by @vojtad)
+  
+  * bug fixes
+    * Fix data being sent on webhook notifier
+
+-------------------------------------------------------------------

Old:
----
  exception_notification-4.2.0.gem

New:
----
  exception_notification-4.2.1.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-exception_notification.spec ++++++
--- /var/tmp/diff_new_pack.E0Az7J/_old  2016-07-30 00:27:31.000000000 +0200
+++ /var/tmp/diff_new_pack.E0Az7J/_new  2016-07-30 00:27:31.000000000 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-exception_notification
-Version:        4.2.0
+Version:        4.2.1
 Release:        0
 %define mod_name exception_notification
 %define mod_full_name %{mod_name}-%{version}

++++++ exception_notification-4.2.0.gem -> exception_notification-4.2.1.gem 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.rdoc new/CHANGELOG.rdoc
--- old/CHANGELOG.rdoc  2016-07-12 22:43:57.000000000 +0200
+++ new/CHANGELOG.rdoc  2016-07-18 01:26:10.000000000 +0200
@@ -1,3 +1,13 @@
+== 4.2.1
+
+* enhancements
+  * Allow customizable backtrace for Slack (by @aried3r)
+  * Add `Mongoid::Errors::DocumentNotFound` to ignored_exceptions (by @nazarok)
+  * Improved text in Slack notifier (by @vojtad)
+
+* bug fixes
+  * Fix data being sent on webhook notifier
+
 == 4.2.0
 
 * enhancements
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2016-07-12 22:43:57.000000000 +0200
+++ new/README.md       2016-07-18 01:26:10.000000000 +0200
@@ -823,7 +823,7 @@
 
 ### :ignore_exceptions
 
-*Array of strings, default: %w{ActiveRecord::RecordNotFound 
AbstractController::ActionNotFound ActionController::RoutingError 
ActionController::UnknownFormat}*
+*Array of strings, default: %w{ActiveRecord::RecordNotFound 
Mongoid::Errors::DocumentNotFound AbstractController::ActionNotFound 
ActionController::RoutingError ActionController::UnknownFormat}*
 
 Ignore specified exception types. To achieve that, you should use the 
`:ignore_exceptions` option, like this:
 
@@ -950,21 +950,13 @@
 
 ## Versions
 
-For v4.0.1, see this tag:
+For v4.2.1, see this tag:
 
-http://github.com/smartinez87/exception_notification/tree/v4.0.1
+http://github.com/smartinez87/exception_notification/tree/v4.2.1
 
-For v4.0.0, see this tag:
+For v4.2.0, see this tag:
 
-http://github.com/smartinez87/exception_notification/tree/v4.0.0
-
-For v3.0.1, see this tag:
-
-http://github.com/smartinez87/exception_notification/tree/v3.0.1
-
-For v3.0.0, see this tag:
-
-http://github.com/smartinez87/exception_notification/tree/v3.0.0
+http://github.com/smartinez87/exception_notification/tree/v4.2.0
 
 For previous releases, visit:
 
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/exception_notification.gemspec 
new/exception_notification.gemspec
--- old/exception_notification.gemspec  2016-07-12 22:43:57.000000000 +0200
+++ new/exception_notification.gemspec  2016-07-18 01:26:10.000000000 +0200
@@ -1,8 +1,8 @@
 Gem::Specification.new do |s|
   s.name = 'exception_notification'
-  s.version = '4.2.0'
+  s.version = '4.2.1'
   s.authors = ["Jamis Buck", "Josh Peek"]
-  s.date = %q{2016-07-12}
+  s.date = %q{2016-07-17}
   s.summary = "Exception notification for Rails apps"
   s.homepage = "https://smartinez87.github.io/exception_notification/";
   s.email = "[email protected]"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/exception_notification/rack.rb 
new/lib/exception_notification/rack.rb
--- old/lib/exception_notification/rack.rb      2016-07-12 22:43:57.000000000 
+0200
+++ new/lib/exception_notification/rack.rb      2016-07-18 01:26:10.000000000 
+0200
@@ -9,22 +9,22 @@
 
       if options.key?(:ignore_if)
         rack_ignore = options.delete(:ignore_if)
-        ExceptionNotifier.ignore_if do |exception, options|
-          options.key?(:env) && rack_ignore.call(options[:env], exception)
+        ExceptionNotifier.ignore_if do |exception, opts|
+          opts.key?(:env) && rack_ignore.call(opts[:env], exception)
         end
       end
 
       if options.key?(:ignore_crawlers)
         ignore_crawlers = options.delete(:ignore_crawlers)
-        ExceptionNotifier.ignore_if do |exception, options|
-          options.key?(:env) && from_crawler(options[:env], ignore_crawlers)
+        ExceptionNotifier.ignore_if do |exception, opts|
+          opts.key?(:env) && from_crawler(opts[:env], ignore_crawlers)
         end
       end
 
       @ignore_cascade_pass = options.delete(:ignore_cascade_pass) { true }
 
-      options.each do |notifier_name, options|
-        ExceptionNotifier.register_exception_notifier(notifier_name, options)
+      options.each do |notifier_name, opts|
+        ExceptionNotifier.register_exception_notifier(notifier_name, opts)
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/exception_notifier/slack_notifier.rb 
new/lib/exception_notifier/slack_notifier.rb
--- old/lib/exception_notifier/slack_notifier.rb        2016-07-12 
22:43:57.000000000 +0200
+++ new/lib/exception_notifier/slack_notifier.rb        2016-07-18 
01:26:10.000000000 +0200
@@ -8,6 +8,7 @@
       super
       begin
         @ignore_data_if = options[:ignore_data_if]
+        @backtrace_lines = options[:backtrace_lines]
 
         webhook_url = options.fetch(:webhook_url)
         @message_opts = options.fetch(:additional_parameters, {})
@@ -18,10 +19,21 @@
     end
 
     def call(exception, options={})
-      env = options[:env] || {}
-      title = "#{env['REQUEST_METHOD']} <#{env['REQUEST_URI']}>"
-      data = (env['exception_notifier.exception_data'] || 
{}).merge(options[:data] || {})
-      text = "*An exception occurred while doing*: `#{title}`\n"
+      exception_name = "*#{exception.class.to_s =~ /^[aeiou]/i ? 'An' : 'A'}* 
`#{exception.class.to_s}`"
+
+      if options[:env].nil?
+        data = options[:data] || {}
+        text = "#{exception_name} *occured in background*\n"
+      else
+        env = options[:env]
+        data = (env['exception_notifier.exception_data'] || 
{}).merge(options[:data] || {})
+
+        kontroller = env['action_controller.instance']
+        request = "#{env['REQUEST_METHOD']} <#{env['REQUEST_URI']}>"
+        text = "#{exception_name} *occurred while* `#{env['REQUEST_METHOD']} 
<#{env['REQUEST_URI']}>`"
+        text += " *was processed by* 
`#{kontroller.controller_name}##{kontroller.action_name}`" if kontroller
+        text += "\n"
+      end
 
       clean_message = exception.message.gsub("`", "'")
       fields = [ { title: 'Exception', value: clean_message} ]
@@ -29,7 +41,7 @@
       fields.push({ title: 'Hostname', value: Socket.gethostname })
 
       if exception.backtrace
-        formatted_backtrace = "```#{exception.backtrace.join("\n")}```"
+        formatted_backtrace = @backtrace_lines ? 
"```#{exception.backtrace.first(@backtrace_lines).join("\n")}```" : 
"```#{exception.backtrace.join("\n")}```"
         fields.push({ title: 'Backtrace', value: formatted_backtrace })
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/exception_notifier/webhook_notifier.rb 
new/lib/exception_notifier/webhook_notifier.rb
--- old/lib/exception_notifier/webhook_notifier.rb      2016-07-12 
22:43:57.000000000 +0200
+++ new/lib/exception_notifier/webhook_notifier.rb      2016-07-18 
01:26:10.000000000 +0200
@@ -40,8 +40,8 @@
         options[:body][:session] = request.session
         options[:body][:environment] = request.filtered_env
       end
-      send_notice(exception, options, nil, @default_options) do |msg, opts|
-        HTTParty.send(http_method, url, opts)
+      send_notice(exception, options, nil, @default_options) do |_, _|
+        HTTParty.send(http_method, url, options)
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/exception_notifier.rb 
new/lib/exception_notifier.rb
--- old/lib/exception_notifier.rb       2016-07-12 22:43:57.000000000 +0200
+++ new/lib/exception_notifier.rb       2016-07-18 01:26:10.000000000 +0200
@@ -24,7 +24,7 @@
 
   # Define a set of exceptions to be ignored, ie, dont send notifications when 
any of them are raised.
   mattr_accessor :ignored_exceptions
-  @@ignored_exceptions = %w{ActiveRecord::RecordNotFound 
AbstractController::ActionNotFound ActionController::RoutingError 
ActionController::UnknownFormat ActionController::UrlGenerationError}
+  @@ignored_exceptions = %w{ActiveRecord::RecordNotFound 
Mongoid::Errors::DocumentNotFound AbstractController::ActionNotFound 
ActionController::RoutingError ActionController::UnknownFormat 
ActionController::UrlGenerationError}
 
   mattr_accessor :testing_mode
   @@testing_mode = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/generators/exception_notification/templates/exception_notification.rb 
new/lib/generators/exception_notification/templates/exception_notification.rb
--- 
old/lib/generators/exception_notification/templates/exception_notification.rb   
    2016-07-12 22:43:57.000000000 +0200
+++ 
new/lib/generators/exception_notification/templates/exception_notification.rb   
    2016-07-18 01:26:10.000000000 +0200
@@ -13,7 +13,7 @@
 
 ExceptionNotification.configure do |config|
   # Ignore additional exception types.
-  # ActiveRecord::RecordNotFound, AbstractController::ActionNotFound and 
ActionController::RoutingError are already added.
+  # ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, 
AbstractController::ActionNotFound and ActionController::RoutingError are 
already added.
   # config.ignored_exceptions += %w{ActionView::TemplateError CustomError}
 
   # Adds a condition to decide when an exception must be ignored or not.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2016-07-12 22:43:57.000000000 +0200
+++ new/metadata        2016-07-18 01:26:10.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: exception_notification
 version: !ruby/object:Gem::Version
-  version: 4.2.0
+  version: 4.2.1
 platform: ruby
 authors:
 - Jamis Buck
@@ -9,7 +9,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2016-07-12 00:00:00.000000000 Z
+date: 2016-07-17 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: actionmailer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/dummy/config/boot.rb 
new/test/dummy/config/boot.rb
--- old/test/dummy/config/boot.rb       2016-07-12 22:43:57.000000000 +0200
+++ new/test/dummy/config/boot.rb       2016-07-18 01:26:10.000000000 +0200
@@ -3,4 +3,4 @@
 # Set up gems listed in the Gemfile.
 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
 
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/dummy/config/environments/test.rb 
new/test/dummy/config/environments/test.rb
--- old/test/dummy/config/environments/test.rb  2016-07-12 22:43:57.000000000 
+0200
+++ new/test/dummy/config/environments/test.rb  2016-07-18 01:26:10.000000000 
+0200
@@ -8,9 +8,6 @@
   # and recreated between test runs.  Don't rely on the data there!
   config.cache_classes = true
 
-  # Log error messages when you accidentally call methods on nil.
-  config.whiny_nils = true
-
   # Show full error reports and disable caching
   config.consider_all_requests_local       = true
   config.action_controller.perform_caching = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/campfire_notifier_test.rb 
new/test/exception_notifier/campfire_notifier_test.rb
--- old/test/exception_notifier/campfire_notifier_test.rb       2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/campfire_notifier_test.rb       2016-07-18 
01:26:10.000000000 +0200
@@ -1,5 +1,11 @@
 require 'test_helper'
-require 'tinder'
+
+# silence_warnings trick around require can be removed once
+# https://github.com/collectiveidea/tinder/pull/77
+# gets merged and released
+silence_warnings do
+  require 'tinder'
+end
 
 class CampfireNotifierTest < ActiveSupport::TestCase
 
@@ -80,7 +86,7 @@
   end
 
   def fake_exception
-    exception = begin
+    begin
       5/0
     rescue Exception => e
       e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/email_notifier_test.rb 
new/test/exception_notifier/email_notifier_test.rb
--- old/test/exception_notifier/email_notifier_test.rb  2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/email_notifier_test.rb  2016-07-18 
01:26:10.000000000 +0200
@@ -101,7 +101,7 @@
   end
 
   test "mail should have a descriptive subject" do
-    assert_match /^\[Dummy ERROR\]\s+\(ZeroDivisionError\) "divided by 0"$/, 
@mail.subject
+    assert_match(/^\[Dummy ERROR\]\s+\(ZeroDivisionError\) "divided by 0"$/, 
@mail.subject)
   end
 
   test "mail should say exception was raised in background at show timestamp" 
do
@@ -165,7 +165,7 @@
       :email_format => :text
     )
 
-    assert_match /invalid_encoding\s+: R__sum__/, mail.encoded
+    assert_match(/invalid_encoding\s+: R__sum__/, mail.encoded)
   end
 
   test "should send email using ActionMailer" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/hipchat_notifier_test.rb 
new/test/exception_notifier/hipchat_notifier_test.rb
--- old/test/exception_notifier/hipchat_notifier_test.rb        2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/hipchat_notifier_test.rb        2016-07-18 
01:26:10.000000000 +0200
@@ -1,5 +1,11 @@
 require 'test_helper'
-require 'hipchat'
+
+# silence_warnings trick around require can be removed once
+# https://github.com/hipchat/hipchat-rb/pull/174
+# gets merged and released
+silence_warnings do
+  require 'hipchat'
+end
 
 class HipchatNotifierTest < ActiveSupport::TestCase
 
@@ -152,7 +158,7 @@
   end
 
   def fake_exception
-    exception = begin
+    begin
       5/0
     rescue Exception => e
       e
@@ -160,7 +166,7 @@
   end
 
   def fake_exception_with_html_characters
-    exception = begin
+    begin
       raise StandardError.new('an error with <html> characters')
     rescue Exception => e
       e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/irc_notifier_test.rb 
new/test/exception_notifier/irc_notifier_test.rb
--- old/test/exception_notifier/irc_notifier_test.rb    2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/irc_notifier_test.rb    2016-07-18 
01:26:10.000000000 +0200
@@ -108,7 +108,7 @@
   private
 
   def fake_exception
-    exception = begin
+    begin
       5/0
     rescue Exception => e
       e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/sidekiq_test.rb 
new/test/exception_notifier/sidekiq_test.rb
--- old/test/exception_notifier/sidekiq_test.rb 2016-07-12 22:43:57.000000000 
+0200
+++ new/test/exception_notifier/sidekiq_test.rb 2016-07-18 01:26:10.000000000 
+0200
@@ -12,6 +12,13 @@
 end
 
 class SidekiqTest < ActiveSupport::TestCase
+  setup do
+    @_original_sidekiq_logger = Sidekiq::Logging.logger
+
+    # Silence sidekiq warning to stdout
+    Sidekiq::Logging.logger = nil
+  end
+
   test "should call notify_exception when sidekiq raises an error" do
     server = MockSidekiqServer.new
     message = Hash.new
@@ -24,4 +31,8 @@
 
     server.handle_exception(exception, message)
   end
+
+  teardown do
+    Sidekiq::Logging.logger = @_original_sidekiq_logger
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/slack_notifier_test.rb 
new/test/exception_notifier/slack_notifier_test.rb
--- old/test/exception_notifier/slack_notifier_test.rb  2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/slack_notifier_test.rb  2016-07-18 
01:26:10.000000000 +0200
@@ -60,6 +60,18 @@
     assert_equal slack_notifier.notifier.username, options[:username]
   end
 
+  test "should send the notification with specific backtrace lines" do
+    options = {
+      webhook_url: "http://slack.webhook.url";,
+      backtrace_lines: 1
+    }
+
+    Slack::Notifier.any_instance.expects(:ping).with('', 
fake_notification(@exception, {}, nil, 1))
+
+    slack_notifier = ExceptionNotifier::SlackNotifier.new(options)
+    slack_notifier.call(@exception)
+  end
+
   test "should pass the additional parameters to Slack::Notifier.ping" do
     options = {
       webhook_url: "http://slack.webhook.url";,
@@ -106,7 +118,7 @@
 
     expected_data_string = "foo: bar\njohn: doe\nuser_id: 5"
 
-    Slack::Notifier.any_instance.expects(:ping).with('', 
fake_notification(@exception, expected_data_string))
+    Slack::Notifier.any_instance.expects(:ping).with('', 
fake_notification(@exception, notification_options, expected_data_string))
     slack_notifier = ExceptionNotifier::SlackNotifier.new(options)
     slack_notifier.call(@exception, notification_options)
   end
@@ -165,12 +177,28 @@
     ]
   end
 
-  def fake_notification(exception = @exception, data_string = nil)
-    text = "*An exception occurred while doing*: ` <>`\n"
+  def fake_notification(exception = @exception, notification_options = {}, 
data_string = nil, expected_backtrace_lines = nil)
+    exception_name = "*#{exception.class.to_s =~ /^[aeiou]/i ? 'An' : 'A'}* 
`#{exception.class.to_s}`"
+    if notification_options[:env].nil?
+      text = "#{exception_name} *occured in background*"
+    else
+      env = notification_options[:env]
+
+      kontroller = env['action_controller.instance']
+      request = "#{env['REQUEST_METHOD']} <#{env['REQUEST_URI']}>"
+
+      text = "#{exception_name} *occurred while* `#{request}`"
+      text += " *was processed by* 
`#{kontroller.controller_name}##{kontroller.action_name}`" if kontroller
+    end
+
+    text += "\n"
 
     fields = [ { title: 'Exception', value: exception.message} ]
     fields.push({ title: 'Hostname', value: 'example.com' })
-    fields.push({ title: 'Backtrace', value: 
"```#{fake_backtrace.join("\n")}```" }) if exception.backtrace
+    if exception.backtrace
+      formatted_backtrace = expected_backtrace_lines ? 
"```#{exception.backtrace.first(expected_backtrace_lines).join("\n")}```" : 
"```#{exception.backtrace.join("\n")}```"
+      fields.push({ title: 'Backtrace', value: formatted_backtrace })
+    end
     fields.push({ title: 'Data', value: "```#{data_string}```" }) if 
data_string
 
     { attachments: [ color: 'danger', text: text, fields: fields, mrkdwn_in: 
%w(text fields) ] }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier/webhook_notifier_test.rb 
new/test/exception_notifier/webhook_notifier_test.rb
--- old/test/exception_notifier/webhook_notifier_test.rb        2016-07-12 
22:43:57.000000000 +0200
+++ new/test/exception_notifier/webhook_notifier_test.rb        2016-07-18 
01:26:10.000000000 +0200
@@ -14,7 +14,7 @@
     assert_equal response[:body][:exception][:error_class], "ZeroDivisionError"
     assert_includes response[:body][:exception][:message], "divided by 0"
     assert_includes response[:body][:exception][:backtrace], 
"/exception_notification/test/webhook_notifier_test.rb:48"
-    
+
     assert response[:body][:request][:cookies].has_key?(:cookie_item1)
     assert_equal response[:body][:request][:url], "http://example.com/example";
     assert_equal response[:body][:request][:ip_address], "192.168.1.1"
@@ -25,6 +25,16 @@
     assert response[:body][:data][:extra_data].has_key?(:data_item1)
   end
 
+  test "should send webhook notification with correct params data" do
+    url = 'http://localhost:8000'
+    fake_exception.stubs(:backtrace).returns('the backtrace')
+    webhook = ExceptionNotifier::WebhookNotifier.new({:url => url})
+
+    HTTParty.expects(:send).with(:post, url, fake_params)
+
+    webhook.call(fake_exception)
+  end
+
   test "should call pre/post_callback if specified" do
     HTTParty.stubs(:send).returns(fake_response)
     webhook = ExceptionNotifier::WebhookNotifier.new({:url => 
'http://localhost:8000'})
@@ -58,8 +68,24 @@
     }
   end
 
+  def fake_params
+    {
+      :body => {
+        :server => Socket.gethostname,
+        :process => $$,
+        :rails_root => Rails.root,
+        :exception => {
+          :error_class => 'ZeroDivisionError',
+          :message => 'divided by 0'.inspect,
+          :backtrace => 'the backtrace'
+        },
+        :data => {}
+      }
+    }
+  end
+
   def fake_exception
-    exception = begin
+    @fake_exception ||= begin
       5/0
     rescue Exception => e
       e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/exception_notifier_test.rb 
new/test/exception_notifier_test.rb
--- old/test/exception_notifier_test.rb 2016-07-12 22:43:57.000000000 +0200
+++ new/test/exception_notifier_test.rb 2016-07-18 01:26:10.000000000 +0200
@@ -3,8 +3,8 @@
 class ExceptionNotifierTest < ActiveSupport::TestCase
   test "should have default ignored exceptions" do
     assert_equal ExceptionNotifier.ignored_exceptions,
-      ['ActiveRecord::RecordNotFound', 'AbstractController::ActionNotFound', 
'ActionController::RoutingError',
-       'ActionController::UnknownFormat', 
'ActionController::UrlGenerationError']
+      ['ActiveRecord::RecordNotFound', 'Mongoid::Errors::DocumentNotFound', 
'AbstractController::ActionNotFound',
+       'ActionController::RoutingError', 'ActionController::UnknownFormat', 
'ActionController::UrlGenerationError']
   end
 
   test "should have email notifier registered" do


Reply via email to