Sha256: 2b3c80770cc96c7a8cae33a46866e81c23efaa40246e12c0aeea7dc38596906f

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 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)
    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

3 entries across 3 versions & 1 rubygems

Version Path
kintone-0.1.2 spec/kintone/command/app_spec.rb
kintone-0.1.1 spec/kintone/command/app_spec.rb
kintone-0.1.0 spec/kintone/command/app_spec.rb