Skip to content

Commit

Permalink
Merge pull request #231 from intercom/MM/hide_default_launcher
Browse files Browse the repository at this point in the history
add hide_default_launcher
  • Loading branch information
mmartinic authored Oct 3, 2016
2 parents 5768fda + 9c10057 commit 3a4d7f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/intercom-rails/script_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def intercom_settings
hsh[:session_duration] = @session_duration if @session_duration.present?
hsh[:widget] = widget_options if widget_options.present?
hsh[:company] = company_details if company_details.present?
hsh[:hide_default_launcher] = Config.inbox.style == :custom
hsh
end

Expand Down
2 changes: 1 addition & 1 deletion spec/script_tag_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
:email => '[email protected]',
:user_id => 'marco',
})
expect(script_tag.csp_sha256).to eq("'sha256-qLRbekKD6dEDMyLKPNFYpokzwYCz+WeNPqJE603mT24='")
expect(script_tag.csp_sha256).to eq("'sha256-QmMmBpC2AxZc9zd18FvMACQwKPbnGG/kGMN4dGJeB3w='")
end

it 'inserts a valid nonce if present' do
Expand Down
4 changes: 3 additions & 1 deletion spec/script_tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ def sha256_hmac(secret, input)
it 'knows about :custom' do
IntercomRails.config.inbox.style = :custom
expect(ScriptTag.new.intercom_settings['widget']).to eq({'activator' => '#Intercom'})
expect(ScriptTag.new.intercom_settings['hide_default_launcher']).to eq(true)
end
it 'knows about :custom_activator' do
IntercomRails.config.inbox.style = :custom
IntercomRails.config.inbox.custom_activator = '.intercom'
expect(ScriptTag.new.intercom_settings['widget']).to eq({'activator' => '.intercom'})
expect(ScriptTag.new.intercom_settings['hide_default_launcher']).to eq(true)
end
end

Expand Down Expand Up @@ -169,7 +171,7 @@ def sha256_hmac(secret, input)
:email => '[email protected]',
:user_id => 'marco',
})
expect(script_tag.csp_sha256).to eq("'sha256-qLRbekKD6dEDMyLKPNFYpokzwYCz+WeNPqJE603mT24='")
expect(script_tag.csp_sha256).to eq("'sha256-QmMmBpC2AxZc9zd18FvMACQwKPbnGG/kGMN4dGJeB3w='")
end

it 'inserts a valid nonce if present' do
Expand Down

0 comments on commit 3a4d7f0

Please sign in to comment.