Browse files

add test for environment filters, remove the attr_accessor and put th…

…e filter_params back to what it was
  • Loading branch information...
1 parent ddf5c73 commit 1a896bd631f97a5bb591efd438fa928ff8ca72f4 @jgeiger jgeiger committed Sep 5, 2008
Showing with 16 additions and 1 deletion.
  1. +1 −1 lib/hoptoad_notifier.rb
  2. +15 −0 test/hoptoad_notifier_test.rb
View
2 lib/hoptoad_notifier.rb
@@ -13,7 +13,7 @@ module HoptoadNotifier
IGNORE_DEFAULT.freeze
class << self
- attr_accessor :host, :port, :secure, :api_key, :params_filters, :environment_filters
+ attr_accessor :host, :port, :secure, :api_key, :filter_params
attr_reader :backtrace_filters
# Takes a block and adds it to the list of backtrace filters. When the filters
View
15 test/hoptoad_notifier_test.rb
@@ -126,6 +126,21 @@ def rescue_action e
assert_equal( {:abc => "<filtered>", :def => "<filtered>", :ghi => "789"},
@controller.send(:clean_hoptoad_params, :abc => "123", :def => "456", :ghi => "789" ) )
end
+
+ should "add filters to the environment filters" do
+ assert_difference "HoptoadNotifier.environment_filters.length", 2 do
+ HoptoadNotifier.configure do |config|
+ config.environment_filters << "secret"
+ config.environment_filters << "supersecret"
+ end
+ end
+
+ assert HoptoadNotifier.environment_filters.include?( "secret" )
+ assert HoptoadNotifier.environment_filters.include?( "supersecret" )
+
+ assert_equal( {:secret => "<filtered>", :supersecret => "<filtered>", :ghi => "789"},
+ @controller.send(:clean_hoptoad_environment, :secret => "123", :supersecret => "456", :ghi => "789" ) )
+ end
should "have at default ignored exceptions" do
assert HoptoadNotifier::IGNORE_DEFAULT.any?

0 comments on commit 1a896bd

Please sign in to comment.