spec/basic_methods/post_spec.rb in lhc-8.1.1 vs spec/basic_methods/post_spec.rb in lhc-9.0.0
- old
+ new
@@ -15,26 +15,26 @@
.with(body: feedback.to_json)
.to_return(status: 200, body: feedback.to_json, headers: { 'Content-Encoding' => 'UTF-8' })
end
it 'does a post request when providing a complete url' do
- LHC.post('http://datastore/v2/feedbacks', body: feedback.to_json)
+ LHC.post('http://datastore/v2/feedbacks', body: feedback)
end
it 'does a post request when providing the name of a configured endpoint' do
url = 'http://{+datastore}/v2/feedbacks'
options = { params: { datastore: 'datastore' } }
LHC.configure { |c| c.endpoint(:feedbacks, url, options) }
- LHC.post(:feedbacks, body: feedback.to_json)
+ LHC.post(:feedbacks, body: feedback)
end
it 'it makes response data available in a rails way' do
- response = LHC.post('http://datastore/v2/feedbacks', body: feedback.to_json)
+ response = LHC.post('http://datastore/v2/feedbacks', body: feedback)
expect(response.data.source_id).to eq 'aaa'
end
it 'provides response headers' do
- response = LHC.post('http://datastore/v2/feedbacks', body: feedback.to_json)
+ response = LHC.post('http://datastore/v2/feedbacks', body: feedback)
expect(response.headers).to be
end
end
end