Sha256: 7039a8f61d3b4da01991fd8fc523dccfe516fe79fab63145c8f85b91614e740e

Contents?: true

Size: 775 Bytes

Versions: 31

Compression:

Stored size: 775 Bytes

Contents

require 'support/capybara_app_helper'

RSpec.describe "Facebook Integration" do
  before do
    setup_app(action: :facebook) do |tracker|
      tracker.handler :facebook, { custom_audience: 'my-audience' }
    end
    visit '/'
  end

  subject { page }

  it "embeds the script tag with tracking event from the controller action" do
    expect(page).to have_content('window._fbq.push(["addPixelId", "my-audience"]);')
    expect(page.body).to include('https://www.facebook.com/tr?id=my-audience&ev=PixelInitialized')
    expect(page).to have_content('window._fbq.push(["track","conversion-event",{"value":"1","currency":"EUR"}]);')
    expect(page.body).to include('https://www.facebook.com/offsite_event.php?id=conversion-event&value=1&currency=EUR')
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rack-tracker-1.13.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.12.1 spec/integration/facebook_integration_spec.rb
rack-tracker-1.12.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.11.2 spec/integration/facebook_integration_spec.rb
rack-tracker-1.11.1 spec/integration/facebook_integration_spec.rb
rack-tracker-1.11.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.10.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.9.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.8.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.7.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.6.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.5.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.4.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.3.1 spec/integration/facebook_integration_spec.rb
rack-tracker-1.3.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.2.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.1.0 spec/integration/facebook_integration_spec.rb
rack-tracker-1.0.2 spec/integration/facebook_integration_spec.rb
rack-tracker-1.0.1 spec/integration/facebook_integration_spec.rb
rack-tracker-1.0.0 spec/integration/facebook_integration_spec.rb