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-1.4.2 tests/test_app/spec/models/bots_spec.rb
impressionist-1.4.1 test_app/spec/models/bots_spec.rb
impressionist-1.4.0 test_app/spec/models/bots_spec.rb
impressionist-1.3.2 test_app/spec/models/bots_spec.rb
impressionist-1.3.1 test_app/spec/models/bots_spec.rb
impressionist-1.3.0 test_app/spec/models/bots_spec.rb
impressionist-1.2.0 test_app/spec/models/bots_spec.rb