File: bot_user_agent_spec.rb

package info (click to toggle)
ruby-useragent 0.16.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 368 kB
  • sloc: ruby: 4,824; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describe "UserAgent: 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'" do
  before do
    @useragent = UserAgent.parse("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")
  end

  it { expect(@useragent).to be_bot }
end

describe "UserAgent: 'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'" do
  before do
    @useragent = UserAgent.parse("Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)")
  end

  it { expect(@useragent).to be_bot }
end

describe "UserAgent: 'Twitterbot/1.0'" do
  before do
    @useragent = UserAgent.parse("Twitterbot/1.0")
  end

  it { expect(@useragent).to be_bot}
end