Sha256: fbd1b027ac1a6dd9c6ed4f6505d03c642186954a71bad0513e3927ea79772c2f

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require "test_helper"

class FacebookTest < Minitest::Test
  test "detects facebook" do
    browser = Browser.new(Browser["FACEBOOK"])

    assert_equal "Facebook", browser.name
    assert browser.facebook?
    assert :facebook, browser.id
    assert_equal "135.0.0.45.90", browser.full_version
    assert_equal "135", browser.version
  end

  test "detects new facebook on iOS" do
    browser = Browser.new(Browser["FACEBOOK_IOS"])

    assert_equal "Facebook", browser.name
    assert browser.facebook?
    assert :facebook, browser.id
    assert_equal "AppleWebKit/605.1.15", browser.full_version
    assert_equal "AppleWebKit/605", browser.version
  end

  test "detects new facebook on Android" do
    browser = Browser.new(Browser["FACEBOOK_ANDROID"])

    assert_equal "Facebook", browser.name
    assert browser.facebook?
    assert :facebook, browser.id
    assert_equal "214.0.0.43.83", browser.full_version
    assert_equal "214", browser.version
  end

  test "detects version by range" do
    browser = Browser.new(Browser["FACEBOOK"])
    assert browser.facebook?(%w[>=135])
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
browser-5.3.1 test/unit/facebook_test.rb
browser-5.3.0 test/unit/facebook_test.rb
browser-5.2.0 test/unit/facebook_test.rb
browser-5.1.0 test/unit/facebook_test.rb
browser-5.0.0 test/unit/facebook_test.rb
browser-4.2.0 test/unit/facebook_test.rb
browser-4.1.0 test/unit/facebook_test.rb
browser-4.0.0 test/unit/facebook_test.rb
browser-3.0.3 test/unit/facebook_test.rb
browser-3.0.2 test/unit/facebook_test.rb
browser-3.0.1 test/unit/facebook_test.rb
browser-3.0.0 test/unit/facebook_test.rb
browser-2.7.1 test/unit/facebook_test.rb
browser-2.7.0 test/unit/facebook_test.rb
browser-2.6.1 test/unit/facebook_test.rb
browser-2.6.0 test/unit/facebook_test.rb