Sha256: e065ebaf54e13514ee0e24e5e8c49ae65865135c72f317eef44bedc38ab4ceef

Contents?: true

Size: 850 Bytes

Versions: 2

Compression:

Stored size: 850 Bytes

Contents

require 'spec_helper'
require 'kintone/command/space_body'
require 'kintone/api'

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

  describe '#update' do
    subject { target.update(id, body) }

    context '' do
      before(:each) do
        stub_request(
          :put,
          'https://example.cybozu.com/k/v1/space/body.json'
        )
          .with(body: { id: 1, body: '<b>総務課</b>専用のスペースです。' }.to_json)
          .to_return(body: '{}', status: 200,
                     headers: { 'Content-type' => 'application/json' })
      end

      let(:id) { 1 }
      let(:body) { '<b>総務課</b>専用のスペースです。' }

      it { expect(subject).to eq({}) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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