Open stefan-kolb opened 9 years ago
I never had such issues with the final version. What it indeed does is to replay the interaction for all further assertions. Meaning the first create is recorded and its assertion run, whereas all further assertions are then based on the recorded interaction and thus do not expect the name is already taken
error.
Were there any changes regarding the RSpec
gem recently?
Not that I know of. I also checked out your last commit.
Same problem there. The first request to post "/endpoints/#{@endpoint}/applications", application, request_headers
succeeds and writes a cassette which gets overriden or just the post request? on the second attempt. Dunno what I'm missing there.
It looks like it just ignores the first recording, records a second time, and only matches requests on the third run.
From my understanding it is very dependent on the record mode how the behavior is:
With :all
these tests will never work as every new call in before will be re-recorded.
With :new_episodes
the first call will be recorded, all subsequent will be replayed which should work in that case.
There may also be side effects if some interactions already exists in a cassette or a parent cassette (which we don't use by exclude: true).
To record new one must delete the files manually however. Or maybe we can use a hacked https://www.relishapp.com/vcr/vcr/v/1-6-0/docs/cassettes/automatic-re-recording.
Maybe we can also set the recording flag on non-repeatable interactions explicitely.
I still wonder how this worked for you. Did you only record with :new_episodes
or :once
?
Some tests that use rspec/wait
gem should have failed then tho as the first request that will be too early will be replayed all the time?!
Tests are failing for me (especially Heroku for now). It's pretty hard to debug this stuff ^^
@croeck Should the before block really be run before each of the included examples? How can this work? Shouldn't it return a
name is already taken
error at the second call (as it always does for me)? I don't fully understand the control flow I think. Should it replay the interaction on the second call?