내 사양이 master 분기로 전달됩니다. 새 분기를 만들고 구독과 관련이없는 코드를 완전히 수정하면 실패 할 것입니다. 내가 그들을 통과시킬 수있는 유일한 방법은 내 vcr.rb가 :record => :new_episodes
이되도록 변경하는 것입니다.VCR 처리되지 않은 http 요청 오류
이 옵션을 켜 놓으면 거의 언제나 내 사양이 실행될 때마다 Git 로그를 희석시키는 커밋 된 카세트에 대한 새로운 수정 된 데이터 파일이 생깁니다.
이 문제를 해결하는 방법에 대한 제안 사항이 있으십니까? 깨는 많은 사양은이 정규식을 기반으로합니다.
describe "#change_plan_to", vcr: {match_requests_on: [:method, :uri, :body]} do
이 정규 표현식을 너무 열어서 변경할 수 있습니까? 스트라이프 API 호출로 스펙을 다른 방법으로 전달할 수 없었습니다.
Failure/Error: @subscription.create_stripe_customer
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
POST https://api.stripe.com/v1/customers
VCR is currently using the following cassette:
- /Users/app/spec/data/Subscription/_change_plan_to/stripe_customer_subscription_plan_/name/.json
- :record => :once
- :match_requests_on => [:method, :uri, :body]
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 (:once) does not allow new requests to be recorded
to a previously recorded cassette. You can delete the cassette file and re-run
your tests to allow the cassette to be recorded with this request [4].
* The cassette contains 109 HTTP interactions that have not been
played back. If your request is non-deterministic, you may need to
change your :match_requests_on cassette option to be more lenient
or use a custom request matcher to allow it to match [5].
[1] https://www.relishapp.com/vcr/vcr/v/2-5-0/docs/configuration/debug-logging
[2] https://www.relishapp.com/vcr/vcr/v/2-5-0/docs/record-modes/new-episodes
[3] https://www.relishapp.com/vcr/vcr/v/2-5-0/docs/configuration/ignore-request
[4] https://www.relishapp.com/vcr/vcr/v/2-5-0/docs/record-modes/once
[5] https://www.relishapp.com/vcr/vcr/v/2-5-0/docs/request-matching
================================================================================
# ./app/models/subscription.rb:83:in `create_stripe_customer'
# ./spec/models/subscription_spec.rb:68:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
좀 더 알아 냈습니다. 스펙은 새 스펙을 스택에 추가 할 때만 중단됩니다. 더 많은 것들이 스위트에 추가되면 어떻게 깨지나요?
통찰력있는 답변을 보내 주셔서 감사합니다. 내가 시체를 제거하면 스펙은 통과하지 못한다. 어떻게 처리 할 것인가? 디버거를 켜고 내가 본 것에 붙여 넣을 것입니다. –
다음과 같은 오류가 있습니다. https://gist.github.com/anonymous/0661a0e821ae907de0e3 및 spec : https://gist.github.com/anonymous/588697967840ee97317f –
이전에 대해 읽었으므로 여전히 실패합니다 : https://gist.github.com/anonymous/672bf704fd7ae3aec989 –