Sha256: de5d18e24e18071095ea4e5cae1f0b306bdaab038c7f5faba5ed93755a449294

Contents?: true

Size: 1016 Bytes

Versions: 69

Compression:

Stored size: 1016 Bytes

Contents

require 'spec_helper'

describe Errplane::Configuration do
  before do
    @configuration = Errplane::Configuration.new
  end

  describe "#ignore_user_agent?" do
    it "should be true for user agents that have been set as ignorable" do
      @configuration.ignored_user_agents = %w{Googlebot}
      @configuration.ignore_user_agent?("Googlebot/2.1").should be_true
    end

    it "should be false for user agents that have not been set as ignorable" do
      @configuration.ignored_user_agents = %w{Googlebot}
      @configuration.ignore_user_agent?("Mozilla/5.0").should be_false
    end

    it "should be false if the ignored user agents list is empty" do
      @configuration.ignored_user_agents = []
      @configuration.ignore_user_agent?("Googlebot/2.1").should be_false
    end

    it "should be false if the ignored user agents list is inadvertently set to nil" do
      @configuration.ignored_user_agents = nil
      @configuration.ignore_user_agent?("Googlebot/2.1").should be_false
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
errplane-1.0.15 spec/unit/configuration_spec.rb
errplane-1.0.14 spec/unit/configuration_spec.rb
errplane-1.0.13 spec/unit/configuration_spec.rb
errplane-1.0.11 spec/unit/configuration_spec.rb
errplane-1.0.10 spec/unit/configuration_spec.rb
errplane-1.0.9 spec/unit/configuration_spec.rb
errplane-1.0.8 spec/unit/configuration_spec.rb
errplane-1.0.7 spec/unit/configuration_spec.rb
errplane-1.0.6 spec/unit/configuration_spec.rb
errplane-1.0.5 spec/unit/configuration_spec.rb
errplane-1.0.4 spec/unit/configuration_spec.rb
errplane-1.0.3 spec/unit/configuration_spec.rb
errplane-1.0.2 spec/unit/configuration_spec.rb
errplane-1.0.1 spec/unit/configuration_spec.rb
errplane-1.0.0 spec/unit/configuration_spec.rb
errplane-0.6.10 spec/unit/configuration_spec.rb
errplane-0.6.9 spec/unit/configuration_spec.rb
errplane-0.6.8 spec/unit/configuration_spec.rb
errplane-0.6.7 spec/unit/configuration_spec.rb
errplane-0.6.6 spec/unit/configuration_spec.rb