Sha256: 7f2c6116d2dfb0fff874cba4701e2db563fe5ba02368fe3e92fd8035afc22239

Contents?: true

Size: 1.35 KB

Versions: 44

Compression:

Stored size: 1.35 KB

Contents

require './test/test_helper'

class VerifyTest < Minitest::Test

  def test_verify_token
    VCR.use_cassette('verify token') do
      verify_response = Access::Verify.token
      assert verify_response.success
      assert_kind_of Access::VerifyResponse, verify_response
      assert_kind_of Access::Verify, verify_response.oauth_access_token
    end
  end

  def test_verify_filter
    VCR.use_cassette('verify filter') do
      single_filter = '{"program_filter": {"offers": [{"or":[{"terms":{"categories.category_key":[ 39, 1007, 1008, 1009, 1010, 1011, 1012 ] } }, {"terms":{"categories.category_parent_key":[ 39, 1007, 1008, 1009, 1010, 1011, 1012]} } ]}, {"not": {"or": [{"terms":{"categories.category_key":[ 1007 ] } }, {"terms":{"categories.category_parent_key":[ 1007 ] } } ] } } ] } }'
      verify_response = Access::Verify.filter single_filter
      assert verify_response.success
      assert_kind_of Access::VerifyResponse, verify_response
      assert_kind_of Access::Verify, verify_response.categories
      assert_kind_of Access::Verify, verify_response.locations
      assert_kind_of Access::Verify, verify_response.stores
      assert_kind_of Access::Verify, verify_response.offers
      assert_kind_of Access::Redeem, verify_response.offers.redemption_methods.first
      assert_kind_of Access::Category, verify_response.offers.categories.first
    end
  end

end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
access-2.0.26 test/access/verify_test.rb
access-2.0.25 test/access/verify_test.rb
access-2.0.24 test/access/verify_test.rb
access-2.0.23 test/access/verify_test.rb
access-2.0.22 test/access/verify_test.rb
access-2.0.21 test/access/verify_test.rb
access-2.0.20 test/access/verify_test.rb
access-2.0.19 test/access/verify_test.rb
access-2.0.18 test/access/verify_test.rb
access-2.0.17 test/access/verify_test.rb
access-2.0.15 test/access/verify_test.rb
access-2.0.14 test/access/verify_test.rb
access-2.0.13 test/access/verify_test.rb
access-2.0.11 test/access/verify_test.rb
access-2.0.10 test/access/verify_test.rb
access-2.0.9 test/access/verify_test.rb
access-2.0.8 test/access/verify_test.rb
access-2.0.7 test/access/verify_test.rb
access-2.0.5 test/access/verify_test.rb
access-2.0.4 test/access/verify_test.rb