Sha256: da9277ded949eb9c9fcdfc2f3159a31bd43298ad4b7cb44e72dbfc9d13ffb5a6
Contents?: true
Size: 969 Bytes
Versions: 1
Compression:
Stored size: 969 Bytes
Contents
TestController = Struct.new(:env) do include Rack::Tracker::Controller def index tracker do |t| t.google_analytics :send, category: 'foo' end end end RSpec.describe Rack::Tracker::Controller do describe '#tracker' do pending # let(:event) { Rack::Tracker::GoogleAnalytics::Send.new(category: 'foo') } # let(:controller) { TestController.new({}) } # context 'controller' do # it 'writes the event into env' do # expect { # controller.index # }.to change { # controller.env # }.from({}).to('tracker' => {'google_analytics' => [event]}) # end # it 'returns only the handlers' do # expect( # controller.tracker do |t| # t.google_analytics category: 'foo' # 2.times do # t.facebook some: 'thing' # end # end # ).to eql([:google_analytics, :facebook]) # end # end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rack-tracker-0.1.1 | spec/tracker/controller_spec.rb |