Skip to content

Commit

Permalink
Ignore unknown notification types.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed May 19, 2013
1 parent cd10d0c commit 6fbec59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/panthoot/translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def initialize(params)

def translate!
key = LISTENER_METHODS[type]
return if key.nil?

ActiveSupport::Notifications.instrument "#{key}.panthoot",
key.to_sym => translated_object, :fired_at => fired_at
end
Expand Down
6 changes: 6 additions & 0 deletions spec/requests/notifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,9 @@ def subscribe(type, &block)
end
end
end

describe 'unknown notifications' do
it "should not complain" do
lambda { get '/panthoot/hooks' }.should_not raise_error
end
end

0 comments on commit 6fbec59

Please sign in to comment.