vendredi 22 mai 2015

VCR Gem cassette is not creating

I am using VCR gem for Testing API call .

In which i am getting error like

CR::Errors::UnhandledHTTPRequestError in 'VgService smart smartapi api should be able to fetch inventory items'

================================================================================ An HTTP request has been made that VCR does not know how to handle: GET http://ift.tt/1SnfhWL"password string"report=inventory&username="username"

VCR is currently using the following cassette: - /home/ubuntu/app/spec/vcr/vg/smart_api/fetch_inventory.yml - :record => :none - :match_requests_on => [:method, :uri]

Under the current configuration VCR can not find a suitable HTTP interaction to replay and is prevented from recording new requests. There are a few ways you can deal with this:

  • If you're surprised VCR is raising this error and want insight about how VCR attempted to handle the request, you can use the debug_logger configuration option to log more details [1].
  • You can use the :new_episodes record mode to allow VCR to record this new request to the existing cassette [2].
  • If you want VCR to ignore this request (and others like it), you can set an ignore_request callback [3].
  • The current record mode (:none) does not allow requests to be recorded. You can temporarily change the record mode to :once, delete the cassette file and re-run your tests to allow the cassette to be recorded with this request [4].

    [1] http://ift.tt/1c91W2Q

[2] http://ift.tt/1SnfhWP

[3] http://ift.tt/1c91Ubk

[4] http://ift.tt/1SnfglR

I sending proper Test case but still not able to fulfil the response.

Aucun commentaire:

Enregistrer un commentaire