ruby - Airborne::InvalidJsonError: Api request returned invalid json -
i'm getting below error while testing sample api in airborne ruby.
airborne::invalidjsonerror: api request returned invalid json /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/base.rb:73:in rescue in json_body /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/base.rb:73:in json_body /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/request_expectations.rb:139:in call_with_path /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/airborne-0.2.13/lib/airborne/request_expectations.rb:18:in expect_json ./postapinew_spec.rb:16:in block (2 levels) in '
-e:1:in `load'
-e:1:in `'
--- caused by: ---
json::parsererror: 765: unexpected token @ '' /users/balamurugan/.rvm/gems/ruby-2.4.0/gems/json-2.1.0/lib/json/common.rb:156:in `parse'
code:
require 'rspec' require 'airborne' require 'json' describe 'postapivalidation' 'should validate post api' post 'http://localhost:9997/test', { 'content-type' => 'application/json' , 'accept' => 'application/json' }, { 'params' => {'param1' => 'value1' , 'param2' => 'value2' } } expect_status 200 expect_json(name: 'alex') end end
issue 'except_json
' related methods not working post api. got valid 'except_json
' results api.
how solve issue???
Comments
Post a Comment