Sha256: cfa8949c57df1dd2bb5fdde0aaa7ef4eb7beed094c554d42981fc76131d8b57a
Contents?: true
Size: 976 Bytes
Versions: 17
Compression:
Stored size: 976 Bytes
Contents
require 'support/capybara_app_helper' RSpec.describe "Rails Integration" do before do setup_app(action: :index) do |tracker| tracker.handler :track_all_the_things, { custom_key: 'SomeKey123' } tracker.handler :another_handler, { custom_key: 'AnotherKey42' } end visit '/' end subject { page.html.gsub(/^\s*/, '') } let(:expected_html) do <<-HTML.gsub(/^\s*/, '') <html> <head> <title>Metal Layout</title> <script type="text/javascript"> myAwesomeFunction("tracks", "like", "no-one-else", "SomeKey123"); </script> </head> <body> <h1>welcome to metal#index</h1> <script type="text/javascript"> anotherFunction("tracks-event-from-down-under", "AnotherKey42"); </script> </body> </html> HTML end it "embeds the script tag with tracking event from the controller action" do expect(subject).to eql(expected_html) end end
Version data entries
17 entries across 17 versions & 1 rubygems