Sha256: a84d7cf56f54a99c6a268d7a5501e0c957ba474b0da8fd82624c7c9a01ccb02b

Contents?: true

Size: 710 Bytes

Versions: 27

Compression:

Stored size: 710 Bytes

Contents

require 'spec_helper'

describe Impressionist::Bots do

  describe "self.bot?" do
    it "is true if user_agent is matches wild card" do
      Impressionist::Bots.bot?("google.com bot").should be_true
    end

    it "is true if user_agent is on bot list" do
      Impressionist::Bots.bot?("A-Online Search").should be_true
    end

    it "is false if user_agent is blank" do
      Impressionist::Bots.bot?("").should be_false
      Impressionist::Bots.bot?(nil).should be_false
    end

    it "is false if user_agent is safe" do
      Impressionist::Bots.bot?('127.0.0.1').should be_false
    end

    it "is false if user_agent not given" do
      Impressionist::Bots.bot?.should be_false
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
impressionist-2.0.0 tests/test_app/spec/models/bots_spec.rb
impressionist-1.6.1 tests/test_app/spec/models/bots_spec.rb
impressionist-1.6.0 tests/test_app/spec/models/bots_spec.rb
impressionist-1.5.2 tests/test_app/spec/models/bots_spec.rb
impressionist2-1.5.5 tests/test_app/spec/models/bots_spec.rb
impressionist2-1.5.4 tests/test_app/spec/models/bots_spec.rb
impressionist2-1.5.3 tests/test_app/spec/models/bots_spec.rb
impressionist2-1.5.1 tests/test_app/spec/models/bots_spec.rb
impressionist-1.5.1 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.13 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.12 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.11 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.10 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.9 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.8 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.7 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.6 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.5 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.4 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.3 tests/test_app/spec/models/bots_spec.rb