Sha256: bf1e8e100cb9407a0291ed4fee90f98b9c61f64322223ae7d6394effb1053153

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 Bytes

Contents

require 'spec_helper'

describe Spree::Tracker, :type => :model do
  describe "current" do
    before(:each) { @tracker = create(:tracker) }

    it "returns the first active tracker for the environment" do
      expect(Spree::Tracker.current).to eq(@tracker)
    end

    it "does not return a tracker with a blank analytics_id" do
      @tracker.update_attribute(:analytics_id, '')
      expect(Spree::Tracker.current).to be_nil
    end

    it "does not return an inactive tracker" do
      @tracker.update_attribute(:active, false)
      expect(Spree::Tracker.current).to be_nil
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_core-1.0.7 spec/models/spree/tracker_spec.rb
solidus_core-1.0.6 spec/models/spree/tracker_spec.rb
solidus_core-1.0.5 spec/models/spree/tracker_spec.rb
solidus_core-1.0.4 spec/models/spree/tracker_spec.rb
solidus_core-1.0.3 spec/models/spree/tracker_spec.rb