Sha256: aef13df6558903bb4ac3a362d4cd90681ffdaaeca8cffd11e0c818b9409a0e10

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'helper'))

token = AuthToken.generate

context "Searching categories" do
  context "by listing id" do
    setup do
      run_with_rescue do
        CityGrid::API::AdCenter::Category.search(
          :token         => token,
          :listingId     => 3680332,
          :startIndex    => 0,
          :numberResults => 10
        )
      end
    end
    should("not be empty"){ !topic.empty? }
    should("respond with OK"){ topic.response.code == 200 }
    should("have resources"){ !topic.resources.empty? }
  end

  context "by query" do
    setup do
      run_with_rescue do
        CityGrid::API::AdCenter::Category.search(
          :keywords      => "pizza",
          :startIndex    => 0,
          :numberResults => 10,
          :token         => token
        )
      end
    end
    should("not be empty"){ !topic.empty? }
    should("respond with OK"){ topic.response.code == 200 }
    should("have resources"){ !topic.resources.empty? }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
citygrid_api-0.0.5.1 test/api/ad_center/test_category.rb