Sha256: 70e13d8d75a4a93d16705739ea5d80866d7b37b725d4740575a94133dbf46039

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

require 'spec_helper'
require 'kintone/command/app'

describe Kintone::Command::App do
  let(:target) { Kintone::Command::App.new(api) }
  let(:api) { Kintone::Api.new('example.cybozu.com', 'Administrator', 'cybozu') }

  describe '#get' do
    before(:each) do
      stub_request(
        :get,
        'https://example.cybozu.com/k/v1/app.json'
      )
        .with(query: { id: id })
        .to_return(body: response_data.to_json, status: 200,
                   headers: { 'Content-type' => 'application/json' })
    end

    subject { target.get(id) }

    let(:id) { 4 }

    def response_data
      {
        appId: '4',
        code: '',
        name: 'アプリ',
        description: 'よいアプリです'
      }
    end

    it { is_expected.to be_kind_of(Hash) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kintone-0.1.4 spec/kintone/command/app_spec.rb
kintone-0.1.3 spec/kintone/command/app_spec.rb