Sha256: 123579d92b66e703985910f57e90e46cac942d0d0a84a514f3fea037cade552f
Contents?: true
Size: 1.23 KB
Versions: 2
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' require 'kintone/command/space' require 'kintone/api' describe Kintone::Command::Space do let(:target) { Kintone::Command::Space.new(api) } let(:api) { Kintone::Api.new('example.cybozu.com', 'Administrator', 'cybozu') } describe '#get' do subject { target.get(id) } context '' do before(:each) do stub_request( :get, 'https://example.cybozu.com/k/v1/space.json' ) .with(query: { id: 1 }) .to_return(body: result.to_json, status: 200, headers: { 'Content-type' => 'application/json' }) end let(:id) { 1 } def result { 'id' => '1', 'name' => 'sample space' } end it { expect(subject).to eq(result) } end end describe '#delete' do subject { target.delete(id) } context '' do before(:each) do stub_request( :delete, 'https://example.cybozu.com/k/v1/space.json' ) .with(body: { id: 1 }.to_json) .to_return(body: '{}', status: 200, headers: { 'Content-type' => 'application/json' }) end let(:id) { 1 } it { expect(subject).to be_truthy } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kintone-0.1.4 | spec/kintone/command/space_spec.rb |
kintone-0.1.3 | spec/kintone/command/space_spec.rb |