Sha256: 449cb26e5cc08e305fc7ad991b270d99d13f39a15a1fa412cc61251c739558db

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Mushikago::Tombo::CapturesRequest do
  before :all do
    @request = Mushikago::Tombo::CapturesRequest.new
  end

  subject{ @request }

  it{ should respond_to(:id) }
  it{ should respond_to(:limit) }
  it{ should respond_to(:offset) }
  it{ should respond_to(:domain) }
  it{ should respond_to(:tag) }

  context 'with options' do
    before :all do
      options = {
        :id => 'id',
        :limit => '2',
        :offset => '5',
        :domain => 'hogehoge.com',
        :tag => 'tag',
      }
      @request = Mushikago::Tombo::CapturesRequest.new(options)
    end

    subject{ @request }

    its(:host){ should == Mushikago.config.tombo_endpoint }
    its(:http_method){ should == 'GET' }
    its(:path){ should == '/1/captures.json' }
    its(:id){ should == 'id' }
    its(:limit){ should == '2' }
    its(:offset){ should == '5' }
    its(:domain){ should == 'hogehoge.com' }
    its(:tag){ should == 'tag' }
    its(:url_encoded_params){ should == 'domain=hogehoge.com&id=id&limit=2&offset=5&tag=tag' }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mushikago-sdk-0.2.3 spec/mushikago/tombo/captures_request_spec.rb
mushikago-sdk-0.2.1 spec/mushikago/tombo/captures_request_spec.rb