Sha256: 8765732cf9451c28f25fbc615ddcf4c96875f221895861bc3bd1aaa344dc8d90
Contents?: true
Size: 951 Bytes
Versions: 16
Compression:
Stored size: 951 Bytes
Contents
require 'spec_helper' module Landable class TrackError < StandardError end class SaveError < StandardError end describe Traffic, type: :controller do controller(ApplicationController) do include Landable::Traffic prepend_around_action :track_with_landable! def my_method render nothing: true end end before do routes.draw do get 'my_method' => 'anonymous#my_method' end end describe 'track_with_landable!' do it 'should log errors' do tracker = double('tracker') Landable::Traffic::Tracker.stub(:for).and_return(tracker) tracker.stub(:track).and_raise(TrackError) tracker.stub(:save).and_raise(SaveError) controller.should_receive(:newrelic_notice_error) { |error| error.should be_an_instance_of TrackError } controller.should_receive(:newrelic_notice_error) { |error| error.should be_an_instance_of SaveError } get :my_method end end end end
Version data entries
16 entries across 16 versions & 1 rubygems