Sha256: 0f6e3d904c10429cdb84899d2419e70f0ddb53696e60f0dbb0422939c4fe61dd

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require "test_helper"

class SnapchatTest < Minitest::Test
  test "detects snapchat" do
    browser = Browser.new(Browser["SNAPCHAT"])

    assert_equal "Snapchat", browser.name
    assert browser.snapchat?
    assert :snapchat, browser.id
    assert_equal "10.69.5.72", browser.full_version
    assert_equal "10", browser.version
  end

  test "detects snapchat for badly formatted user agent" do
    browser = Browser.new(Browser["SNAPCHAT_EMPTY_STRING_VERSION"])

    assert_equal "Snapchat", browser.name
    assert browser.snapchat?
    assert :snapchat, browser.id
    assert_equal "10.70.0.0", browser.full_version
    assert_equal "10", browser.version
  end

  test "detects alternate snapchat user agent" do
    browser = Browser.new(Browser["SNAPCHAT_SPACE_VERSION"])

    assert_equal "Snapchat", browser.name
    assert browser.snapchat?
    assert :snapchat, browser.id
    assert_equal "10.70.0.0", browser.full_version
    assert_equal "10", browser.version
  end

  test "detects version by range" do
    browser = Browser.new(Browser["SNAPCHAT"])
    assert browser.snapchat?(%w[>=10])
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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