Sha256: 09bce3b1f2fa2caf8a4afdf12050a38b97206a72d3f90543ab2b9fa04378cd93
Contents?: true
Size: 1.11 KB
Versions: 23
Compression:
Stored size: 1.11 KB
Contents
RSpec.describe Rack::Tracker::GoSquared do def env {misc: 'foobar'} end it 'will be placed in the head' do expect(described_class.position).to eq(:head) expect(described_class.new(env).position).to eq(:head) end describe "with events" do describe "visitor name" do def env {'tracker' => { 'go_squared' => [ { 'class_name' => 'VisitorName', 'name' => 'John Doe' } ] }} end subject { described_class.new(env, tracker: '12345').render } it "will show the right name" do expect(subject).to match(%r{_gs\(\"set\",\"visitorName\",\"John Doe\"\)}) end end describe "visitor details" do def env {'tracker' => { 'go_squared' => [ { 'class_name' => 'VisitorInfo', 'age' => 35, 'favorite_food' => 'pizza' } ] }} end subject { described_class.new(env, tracker: '12345').render } it "will show the right properties" do expect(subject).to match(%r{_gs\(\"set\",\"visitor\",{\"age\":35,\"favorite_food\":\"pizza\"}\)}) end end end end
Version data entries
23 entries across 23 versions & 1 rubygems