Sha256: ec346d99f45df4d3c1461f151aebd975e34a671a37d11998f7e9b403ad1667ca

Contents?: true

Size: 1.2 KB

Versions: 16

Compression:

Stored size: 1.2 KB

Contents

require './test/test_helper'

class FilterTest < Minitest::Test

  def get_first_filter
    VCR.use_cassette('filter/search_first') 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
    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.filter_key
      assert first_filter.name
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
access-2.3.0.pre.rc2 test/access/filter_test.rb
access-2.3.0.pre.rc1 test/access/filter_test.rb
access-2.2.0 test/access/filter_test.rb
access-2.1.5 test/access/filter_test.rb
access-2.1.4 test/access/filter_test.rb
access-2.1.3 test/access/filter_test.rb
access-2.1.2 test/access/filter_test.rb
access-2.1.1 test/access/filter_test.rb
access-2.1.0 test/access/filter_test.rb
access-2.0.55 test/access/filter_test.rb
access-2.0.54 test/access/filter_test.rb
access-2.0.53 test/access/filter_test.rb
access-2.0.52 test/access/filter_test.rb
access-2.0.51 test/access/filter_test.rb
access-2.0.50 test/access/filter_test.rb
access-2.0.49 test/access/filter_test.rb