spec/kintone/command/guests_spec.rb in kintone-0.1.2 vs spec/kintone/command/guests_spec.rb in kintone-0.1.3

- old
+ new

@@ -4,21 +4,22 @@ describe Kintone::Command::Guests do let(:target) { Kintone::Command::Guests.new(api) } let(:api) { Kintone::Api.new('example.cybozu.com', 'Administrator', 'cybozu') } - describe '#create' do + describe '#register' do before(:each) do stub_request( :post, 'https://example.cybozu.com/k/v1/guests.json' ) .with(body: { guests: guests }.to_json) - .to_return(body: '{}', status: 200) + .to_return(body: '{}', status: 200, + headers: { 'Content-type' => 'application/json' }) end - subject { target.create(guests) } + subject { target.register(guests) } let(:guests) do [ { code: 'hoge@example.com', @@ -45,10 +46,11 @@ stub_request( :delete, 'https://example.cybozu.com/k/v1/guests.json' ) .with(body: { guests: guests }.to_json) - .to_return(body: '{}', status: 200) + .to_return(body: '{}', status: 200, + headers: { 'Content-type' => 'application/json' }) end subject { target.delete(guests) } let(:guests) do