Sha256: c7803343cacf3f08ca888e71fceefb7652c2805639a4148219de358318668090

Contents?: true

Size: 1.34 KB

Versions: 27

Compression:

Stored size: 1.34 KB

Contents

require './test/test_helper'

class FilterTest < Minitest::Test

  def get_first_filter
    VCR.use_cassette('filter search') do
      @first_filter = Access::Filter.search(per_page: 1).filters.first
    end
  end

  def test_filters_search
    VCR.use_cassette('filter search') do
      filters_response = Access::Filter.search(per_page: 1)
      assert filters_response.success
      first_filter = filters_response.filters.first
      assert_kind_of Access::FilterResponse, filters_response
      assert_kind_of Access::Link, filters_response.links
      assert_kind_of Access::Info, filters_response.info
      assert_kind_of Array, filters_response.filters
      assert_kind_of Access::Filter, first_filter
      assert first_filter.json_filter
      assert first_filter.hash_filter
    end
  end

  def test_filters_find
    get_first_filter
    VCR.use_cassette('filter find') do
      filters_response = Access::Filter.find(@first_filter.filter_id)
      assert filters_response.success
      first_filter = filters_response.filters.first
      assert_kind_of Access::FilterResponse, filters_response
      assert_kind_of Array, filters_response.filters
      assert_kind_of Access::Filter, first_filter
      assert first_filter.json_filter
      assert first_filter.hash_filter
      assert first_filter.filter_key
      assert first_filter.name
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
access-2.0.41 test/access/filter_test.rb
access-2.0.40 test/access/filter_test.rb
access-2.0.39 test/access/filter_test.rb
access-2.0.38 test/access/filter_test.rb
access-2.0.37 test/access/filter_test.rb
access-2.0.36 test/access/filter_test.rb
access-2.0.34 test/access/filter_test.rb
access-2.0.33 test/access/filter_test.rb
access-2.0.32 test/access/filter_test.rb
access-2.0.31 test/access/filter_test.rb
access-2.0.30 test/access/filter_test.rb
access-2.0.29 test/access/filter_test.rb
access-2.0.28 test/access/filter_test.rb
access-2.0.27 test/access/filter_test.rb
access-2.0.26 test/access/filter_test.rb
access-2.0.25 test/access/filter_test.rb
access-2.0.24 test/access/filter_test.rb
access-2.0.23 test/access/filter_test.rb
access-2.0.22 test/access/filter_test.rb
access-2.0.21 test/access/filter_test.rb