errdo 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ I"�/home/eric/Projects/errdo/app/assets/stylesheets/errdo/errdo.scss?type=text/css&id=c938df2a8e974adaf74aeaec308a79db5ec0b9368f0e07dc8787b27bca323bd7:ET
@@ -0,0 +1 @@
1
+ I"�/home/eric/Projects/errdo/app/assets/stylesheets/errdo/errdo.scss?type=text/css&pipeline=self&id=ff88fe442f3944cb23870c52550f85a0265e90f2cfcbc301bf74411d3a28c155:ET
@@ -0,0 +1 @@
1
+ 4358
@@ -64,6 +64,13 @@ class ErrorsIntegrationTest < ActionDispatch::IntegrationTest
64
64
  end
65
65
  end
66
66
 
67
+ should "not store a configurable dirty param in the params" do
68
+ Errdo.dirty_words += ["dirtyyyyy"]
69
+ get static_generic_error_path, "dirtyyyyy" => "stuff"
70
+ @error_occurrence = Errdo::ErrorOccurrence.last
71
+ assert_equal "...", @error_occurrence.param_values["dirtyyyyy"]
72
+ end
73
+
67
74
  should "only store an error occurrence if same error already exists" do
68
75
  get static_generic_error_path
69
76
  assert_difference 'Errdo::Error.count', 0 do
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ FAILSAFE_FAIL_STRING = "If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong."
4
+
5
+ class PluginsIntegrationTest < ActionDispatch::IntegrationTest
6
+
7
+ setup do
8
+ Errdo.error_name = "errors"
9
+ Errdo.slack_webhook = "https://slack.com/test"
10
+ end
11
+
12
+ context "slack integration" do
13
+ should "send a slack notification when error is hit" do
14
+ stub_request :any, /.*slack.*/
15
+ get static_generic_error_path
16
+ assert_requested :any, /.*slack.*/
17
+ end
18
+
19
+ should "not send a slack notification when error is hit if webhook is nil" do
20
+ Errdo.slack_webhook = nil
21
+ stub_request :any, /.*slack.*/
22
+ get static_generic_error_path
23
+ assert_not_requested :any, /.*slack.*/
24
+ end
25
+
26
+ should "correctly send a notification when there is no database stored error" do
27
+ Errdo.error_name = nil
28
+ stub_request :any, /.*slack.*/
29
+ get static_generic_error_path
30
+ assert_requested :any, /.*slack.*/
31
+ end
32
+
33
+ should "not fail when the slack ping returns an error" do
34
+ stub_request(:any, /.*slack.*/).to_raise(StandardError)
35
+ get static_generic_error_path
36
+ assert_not response.body.include? FAILSAFE_FAIL_STRING
37
+ end
38
+ end
39
+
40
+ teardown do
41
+ Errdo.instance_variable_set(:@slack_notifier, nil)
42
+ Errdo.slack_webhook = nil
43
+ end
44
+
45
+ private
46
+
47
+ def _sign_in(user)
48
+ post user_session_path, 'user[email]' => user.email, 'user[password]' => 'foobar'
49
+ end
50
+
51
+ end
@@ -19,6 +19,11 @@ class ViewsIntegrationTest < ActionDispatch::IntegrationTest
19
19
  get @errdo.error_path(Errdo::Error.last)
20
20
  assert_response :success
21
21
  end
22
+
23
+ should "be able to get an error's page with a specific instance selected" do
24
+ get @errdo.error_path(Errdo::Error.last, occurrence_id: Errdo::ErrorOccurrence.last)
25
+ assert_response :success
26
+ end
22
27
  end
23
28
 
24
29
  end
data/test/test_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  # Configure Rails Environment
2
5
  ENV["RAILS_ENV"] = "test"
3
6
 
@@ -5,6 +8,8 @@ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
8
  ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
9
  require "rails/test_help"
7
10
  require 'minitest/reporters'
11
+ require 'webmock/minitest'
12
+ WebMock.disable_net_connect!(allow: /.*codeclimate.*/)
8
13
 
9
14
  require 'factories'
10
15
 
@@ -0,0 +1,4 @@
1
+ module Dummy
2
+ class Application
3
+ end
4
+ end
@@ -0,0 +1,50 @@
1
+ Errdo.setup do |config|
2
+ # Add words to be scrubbed from the params here. By default, this is
3
+ # %w(password passwd password_confirmation secret confirm_password secret_token)
4
+ # So make sure you add on, not replace!
5
+ # Errdo.dirty_words += ["custom_param"]
6
+
7
+ ## == Authorization and Devise integration ==================
8
+ # If you have the ability to track who's logged in, setting the current_user_method
9
+ # will allow the logged-in user to be recorded with the error
10
+ # config.current_user_method = :current_user
11
+ # Some form of authentication here is basically necessary for authorization
12
+ # config.authenticate_with do
13
+ # warden.authenticate! scope: :user
14
+ # end
15
+
16
+ ## == Authorization =======================
17
+ # Setup authorization to be run as a before filter
18
+ # This is run inside the controller instance so you can setup any authorization you need to.
19
+ # By default, there is no authorization.
20
+ #
21
+ # config.authorize_with do
22
+ # redirect_to root_path unless warden.user.try(:is_admin?)
23
+ # end
24
+ #
25
+ # To use an authorization adapter, pass the name of the adapter. For example,
26
+ # to use with CanCanCan[https://github.com/CanCanCommunity/cancancan], pass it like this.
27
+ # Currently, only cancan/cancancan is supported
28
+ # config.authorize_with :cancan
29
+
30
+ # This determines how the user is displayed on the table of errors
31
+ # Can be any method that a user responds to, I.E. Any method that returns a string
32
+ # when called on user (Default is :email)
33
+ config.user_string_method = :email
34
+
35
+ # Setting this will allow the user string to be linked to the show path
36
+ # Default is the errdo root path
37
+ # config.user_show_path = :user_path
38
+
39
+ ## == Slack Integration ====================
40
+ # See the github page at https://github.com/erichaydel/errdo for more info on how to set up slack
41
+ # If you want to set up slack, this is the only required parameter
42
+ # config.slack_webhook = 'YOUR-WEBHOOK-HERE'
43
+
44
+ # You can customize what icon and name the notification posts with. Default is an explosion and "Errdo-bot"
45
+ # config.slack_icon = ':boom:'
46
+ # config.slack_name = 'Errdo-bot'
47
+
48
+ # This configures the channel to post error notifications to. If nothing is set, it will post the the default
49
+ # config.slack_channel = '#channel'
50
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - erichaydel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: webmock
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: A simple plugin to handle, log, and customize production errors
126
140
  email:
127
141
  - erichaydel@gmail.com
@@ -219,6 +233,7 @@ files:
219
233
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-X/-XnmJEO863Zbwoq-61y5v-tVbpQjxLVGy_7zo6kaO9s.cache
220
234
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-Z/-ZiLYDhc5EMZ0k96SxKfipdygQgJeEfj3f9EWZzDImg.cache
221
235
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-Z/-ZwhIbY8T7e1u5ZkgQIMjIiAgKtv0Iuxkvemq9bxuzM.cache
236
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/-a/-apldCPiPwnim43kBuJQ-YT7FwzZ0_FprprS-I-e-Rk.cache
222
237
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-d/-dRqX93-uEG7WeZRvhsRthMVqAu9oNL6rTxsHiYPpS4.cache
223
238
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-j/-jcE8V0KqYDgIbtMkmh0-dfSmpcgHLAKVV2AOalhFNk.cache
224
239
  - test/dummy/tmp/cache/assets/sprockets/v3.0/-k/-kPWzRHuZ8VWgKsEVn_FiF8RS31HStNgHy9Trh0-ze8.cache
@@ -406,6 +421,7 @@ files:
406
421
  - test/dummy/tmp/cache/assets/sprockets/v3.0/E_/E_LL5zSLuCyv8Dr84P_vJ6qGFh3fqI2bWFJFT6DkW3E.cache
407
422
  - test/dummy/tmp/cache/assets/sprockets/v3.0/E_/E_q2WNQ1YmdzMp5s2IgRYWIgijWZrMoZ3UDhn5TbhZk.cache
408
423
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Ed/EdF8mVzbc-VaCRaef_Kh53C08IdK_h0Cu4UXBO3KiSY.cache
424
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/Ed/EdinPD8mIf074M4Xo0QTD2y32-JYodnFw6_n-HB4HEk.cache
409
425
  - test/dummy/tmp/cache/assets/sprockets/v3.0/F-/F-3BeYYimwjpWVd9KhD_dzMn9zxFCFN7NqUuf3PA5tw.cache
410
426
  - test/dummy/tmp/cache/assets/sprockets/v3.0/FD/FDkBFtB9DEESP7MoXnWwLOSG3v88cnzM-EHpYUQS4Wk.cache
411
427
  - test/dummy/tmp/cache/assets/sprockets/v3.0/FE/FEWcLGldIfToqV6_eXB0dIKGYzzsfBXLjJbg-fl2pv8.cache
@@ -570,6 +586,7 @@ files:
570
586
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TM/TMH-UBnxGtLKZ8x1ftzFyDWzlYA4GFCZRQNP3nH_kvk.cache
571
587
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TQ/TQnZjYmD-eJqhIBEu1XqXX1Vi9sSuAmsbRh7ze1VXvQ.cache
572
588
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSUGmlUe5etN8YjI59-zWCGuyF3LSsOJuzAbLudRli4.cache
589
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSlCtxGS0S-pH3qtUoujIX59cIJJWYUb2rRGPH0WV-8.cache
573
590
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TW/TW88Emj0-c1DSTYnvDlHIDKGJ6LG7FHB1pH5mDPvGDI.cache
574
591
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TY/TYzk1nkc4WNwLXyE2XuydHpF27uQlcFlSbPh2w092J0.cache
575
592
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TZ/TZoI_pEN6swCaroq0VzweHLCPkOECYdEpkeBJd0Bn3Q.cache
@@ -762,6 +779,7 @@ files:
762
779
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hK/hKHFOYNFBS0FHtq9Tx9Ei9FWttOjo0kZN6G83o3E3ZQ.cache
763
780
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hU/hUHRAM5d8kO5H19gr6e5oPg9_euC6KpT4_bskQO3vU0.cache
764
781
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache
782
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/h_/h_eE5ERDLtj-w3BiFatbh6Uqbkjv6-VH0wl8tvuTgXc.cache
765
783
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hf/hflGhFinwoorhMm9WcWgVrmTwVRcrz7nHl7PeZrj0Jc.cache
766
784
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hm/hmFSz7DYPdwGhdMy2-4YMSCEbE2GAHDFvo3rPhVDJq8.cache
767
785
  - test/dummy/tmp/cache/assets/sprockets/v3.0/hq/hqpigrfmP3VObbx-zbHSGkGAy5psI1CZC0AyeFrjTe0.cache
@@ -961,6 +979,7 @@ files:
961
979
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zt/zt98H6qoLRpSDbtbVQtghzuYtOz1-Po0QcDAVWK7XC4.cache
962
980
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zv/zvfByn9a2SXSz6mb_B5wkAIJMltXb2gON_PpjV8Gyl0.cache
963
981
  - test/dummy/tmp/cache/assets/sprockets/v3.0/zw/zwqTCzApUNMz710-JBgR6nos_fF_00TLDbBMbRhMAyw.cache
982
+ - test/dummy/tmp/pids/server.pid
964
983
  - test/factories.rb
965
984
  - test/fixtures/users.yml
966
985
  - test/generators/active_record_generator_test.rb
@@ -969,10 +988,13 @@ files:
969
988
  - test/helpers/views_helper_test.rb
970
989
  - test/integrations/authorization_integration_test.rb
971
990
  - test/integrations/errors_integration_test.rb
991
+ - test/integrations/plugins_integration_test.rb
972
992
  - test/integrations/views_integration_test.rb
973
993
  - test/models/error_occurrence_test.rb
974
994
  - test/models/error_test.rb
975
995
  - test/test_helper.rb
996
+ - test/tmp/config/application.rb
997
+ - test/tmp/config/initializers/errdo.rb
976
998
  homepage: https://github.com/erichaydel/errdo
977
999
  licenses:
978
1000
  - MIT
@@ -1319,6 +1341,7 @@ test_files:
1319
1341
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ea/ea4D7BW5iGpA2OlsX8PpZgNGI8_mvIqNz-Hq9wkiF-0.cache
1320
1342
  - test/dummy/tmp/cache/assets/sprockets/v3.0/KH/KHfmTgXdnbr4E7Zte11WaEEehHLcFUqxbfIsT9Rz-yY.cache
1321
1343
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ch/chYPC7xK2K7xYNps23uVrTBQxOKVEfrM1u7eOzzVFOY.cache
1344
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/-a/-apldCPiPwnim43kBuJQ-YT7FwzZ0_FprprS-I-e-Rk.cache
1322
1345
  - test/dummy/tmp/cache/assets/sprockets/v3.0/1w/1wK9TN6VDmS9LEbP4uFlqo-zRlOd4T5ZFf0Hc9YHmvs.cache
1323
1346
  - test/dummy/tmp/cache/assets/sprockets/v3.0/1w/1wq5l4o3oSN9e5Fi6RfVczrYqdRwLce2QiwmAj6UGbY.cache
1324
1347
  - test/dummy/tmp/cache/assets/sprockets/v3.0/P4/P4s5cMC5eTujCP4ESo7HPprbjALOdEaI0sugZPTkST0.cache
@@ -1581,6 +1604,7 @@ test_files:
1581
1604
  - test/dummy/tmp/cache/assets/sprockets/v3.0/DW/DWa4lkFvliQzfu3gkI1r2R_EH2295dQ8exzqFmVI3L4.cache
1582
1605
  - test/dummy/tmp/cache/assets/sprockets/v3.0/a3/a3v46N94SGH_yt5_nsQOg2qU09kkC8fr86R-6bLBMaw.cache
1583
1606
  - test/dummy/tmp/cache/assets/sprockets/v3.0/5T/5TExc9gFDNeHPplR76pDlFYCxjTmPd5wEot4kyN4x6I.cache
1607
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/Ed/EdinPD8mIf074M4Xo0QTD2y32-JYodnFw6_n-HB4HEk.cache
1584
1608
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Ed/EdF8mVzbc-VaCRaef_Kh53C08IdK_h0Cu4UXBO3KiSY.cache
1585
1609
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ox/ox_A56ZdNavLuRmZlSgVDweYzuwH8x1LrscCYH8eCzg.cache
1586
1610
  - test/dummy/tmp/cache/assets/sprockets/v3.0/sE/sEOf9MfWdOJIVVJn4VOSzn8q7Pf-mArel8ooYoBTGJA.cache
@@ -1655,6 +1679,7 @@ test_files:
1655
1679
  - test/dummy/tmp/cache/assets/sprockets/v3.0/8o/8optjRg4lDH9fmBQqObz5sNQ_V6rZ8cG-4PSlKytJQM.cache
1656
1680
  - test/dummy/tmp/cache/assets/sprockets/v3.0/K3/K3RzJ-MWuDB1v3mQe2pDfV8k7fLNB3YgnVUygVcLupc.cache
1657
1681
  - test/dummy/tmp/cache/assets/sprockets/v3.0/cU/cUeT-raqqjBhGdGZPM_K00tGw9VID5-39wv5J49FjPg.cache
1682
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/h_/h_eE5ERDLtj-w3BiFatbh6Uqbkjv6-VH0wl8tvuTgXc.cache
1658
1683
  - test/dummy/tmp/cache/assets/sprockets/v3.0/fK/fKVFhzy1fMPZXeigeV3Eu8A-jnWqXR2FqGhBq4avPNs.cache
1659
1684
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ZC/ZCIz_IyCYkFWdTDa8_jXM3hnO6o9Z_y2lqm8KMVyQ8E.cache
1660
1685
  - test/dummy/tmp/cache/assets/sprockets/v3.0/VE/VEJ_Ou3XMFioy2DNbTHysVS3wOyxN5z3Tau2_l6DttU.cache
@@ -1754,6 +1779,7 @@ test_files:
1754
1779
  - test/dummy/tmp/cache/assets/sprockets/v3.0/22/22bDwyBTcOVEsjlxM3RxRXIvRp_lTKBKiS70G7pmUFw.cache
1755
1780
  - test/dummy/tmp/cache/assets/sprockets/v3.0/YN/YNPYzGZASXO7-oSvvZoHnhqv-JS0pyNEWFw1EOOF8LM.cache
1756
1781
  - test/dummy/tmp/cache/assets/sprockets/v3.0/BV/BVbuOkAMwBGOnP7OP6XS23jWj7va75f7xlTp7_NN1sA.cache
1782
+ - test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSlCtxGS0S-pH3qtUoujIX59cIJJWYUb2rRGPH0WV-8.cache
1757
1783
  - test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSUGmlUe5etN8YjI59-zWCGuyF3LSsOJuzAbLudRli4.cache
1758
1784
  - test/dummy/tmp/cache/assets/sprockets/v3.0/dn/dnZlPzbjkEogffWbqSp4-eUEAg6RrD0Glm3H_ako-x0.cache
1759
1785
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ae/aecZBDr0kgBSH3SDujVAZOcFrN1J2r-s2DHu53pbzXY.cache
@@ -1782,6 +1808,7 @@ test_files:
1782
1808
  - test/dummy/tmp/cache/assets/sprockets/v3.0/D_/D_KcfHEBsRaZDGqaiFtERXr1g8Av54-9T958jUK7R0A.cache
1783
1809
  - test/dummy/tmp/cache/assets/sprockets/v3.0/ED/EDVZLiJoq6wj93pJxKsK4TI15LIXRqwx4OdFGAAr068.cache
1784
1810
  - test/dummy/tmp/cache/assets/sprockets/v3.0/Ip/IplSosjlbQ5aan_h10fBG52WhsI8ogweDeukCOuwPWI.cache
1811
+ - test/dummy/tmp/pids/server.pid
1785
1812
  - test/dummy/README.rdoc
1786
1813
  - test/dummy/bin/bundle
1787
1814
  - test/dummy/bin/setup
@@ -1802,6 +1829,7 @@ test_files:
1802
1829
  - test/dummy/app/views/static/home.html.erb
1803
1830
  - test/integrations/errors_integration_test.rb
1804
1831
  - test/integrations/views_integration_test.rb
1832
+ - test/integrations/plugins_integration_test.rb
1805
1833
  - test/integrations/authorization_integration_test.rb
1806
1834
  - test/helpers/views_helper_test.rb
1807
1835
  - test/factories.rb
@@ -1810,6 +1838,8 @@ test_files:
1810
1838
  - test/controllers/errors_controller_test.rb
1811
1839
  - test/models/error_occurrence_test.rb
1812
1840
  - test/models/error_test.rb
1841
+ - test/tmp/config/application.rb
1842
+ - test/tmp/config/initializers/errdo.rb
1813
1843
  - test/generators/install_generator_test.rb
1814
1844
  - test/generators/active_record_generator_test.rb
1815
1845
  - test/generators/errdo_generator_test.rb