spec/rest/orders_spec.rb in finapps-5.0.2 vs spec/rest/orders_spec.rb in finapps-5.0.3
- old
+ new
@@ -86,29 +86,29 @@
it('performs a get and returns the response') { expect(subject[RESULTS]).to respond_to(:orders) }
it('each order contains a consumer_id') { expect(subject[RESULTS].orders).to all(have_key('consumer_id')) }
it('returns no error messages') { expect(subject[ERROR_MESSAGES]).to be_empty }
it 'builds query and sends proper request' do
subject
- url = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22$or%22:%5B%7B%22public_id%22:" \
+ url = "#{versioned_api_path}/orders?filter=%7B%22$or%22:%5B%7B%22public_id%22:" \
'%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.last_name%22:%22term%22%7D' \
',%7B%22assignment.last_name%22:%22term%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5E' \
'term%22,%22$options%22:%22i%22%7D%7D%5D,%22status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.' \
'operator_id%22:%22valid_operator%22%7D&page=2&requested=25&sort=status'
expect(WebMock).to have_requested(:get, url)
end
it 'builds query and sends proper request with searchTerm/relation exclusivity' do
params[:searchTerm] = nil
subject
- url = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22status%22:%7B%22$in%22:%5B1," \
+ url = "#{versioned_api_path}/orders?filter=%7B%22status%22:%7B%22$in%22:%5B1," \
'7%5D%7D,%22assignment.operator_id%22:%22valid_operator%22,%22$or%22:%5B%7B%22public_id%22:%7B%22$in' \
'%22:%5B%22valid_order_id%22%5D%7D%7D,%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22' \
'%5D%7D%7D%5D%7D&page=2&requested=25&sort=status'
expect(WebMock).to have_requested(:get, url)
end
it 'builds null assignment query properly when supplied w/ empty string' do
FinApps::REST::Orders.new(client).list(assignment: '')
- url = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v3/orders?filter=%7B%22assignment.operator_id%22:null%7D"
+ url = "#{versioned_api_path}/orders?filter=%7B%22assignment.operator_id%22:null%7D"
expect(WebMock).to have_requested(:get, url)
end
end
end