Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/intercom-rails/auto_include_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def intercom_rails_auto_include

class Filter
CLOSING_BODY_TAG = "</body>"
BLACKLISTED_CONTROLLER_NAMES = %w{ Devise::PasswordsController }
BLOCKED_CONTROLLER_NAMES = %w{ Devise::PasswordsController }

def self.filter(controller)
return if BLACKLISTED_CONTROLLER_NAMES.include?(controller.class.name)
return if BLOCKED_CONTROLLER_NAMES.include?(controller.class.name)
auto_include_filter = new(controller)
return unless auto_include_filter.include_javascript?

Expand Down
4 changes: 2 additions & 2 deletions spec/auto_include_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def current_user
expect(response.body).to eq("<body>Hello world</body>")
end

it 'does not inject if blacklisted controller' do
stub_const("IntercomRails::AutoInclude::Filter::BLACKLISTED_CONTROLLER_NAMES", ["TestController"])
it 'does not inject if blocked controller' do
stub_const("IntercomRails::AutoInclude::Filter::BLOCKED_CONTROLLER_NAMES", ["TestController"])
get :with_current_user_method
expect(response.body).to eq("<body>Hello world</body>")
end
Expand Down