Nach dem, was ich lese hier: https://relishapp.com/vcr/vcr/v/1-11-3/docs/configuration/filter-sensitive-data,Nach sensible Daten Filterung mit VCR, Wieder läuft die Spezifikation irgendwie schlecht URI Fehler
When the interactions are replayed, the sensitive text will replace the substitution string so that the interaction will be identical to what was originally recorded.
Meine vcr_setup.rb Datei sieht wie folgt aus:
require 'vcr'
VCR.config do |c|
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
c.stub_with :fakeweb
c.default_cassette_options = { :record => :once }
c.filter_sensitive_data("<DOMAIN>") do |interaction|
interaction.request.uri.split(":")[1][2..-1]
end
c.filter_sensitive_data("<PASSWORD>") do |interaction|
interaction.request.uri.split(":")[2].split("@")[0]
end
end
interaction.request.uri sieht wie folgt aus (mit dem sensiblen Informationen ersetzt):
"https://<my_secret_domain>:<my_secret_password>@services.someprovider.com:443/enterprise/composite/some_api_call"
Nachdem ich meine rspec Test das erste Mal ausführen, zeigt die Kassette richtig diese:
uri: https://<DOMAIN>:<PASSWORD>@services.someprovider.com:443/enterprise/composite/some_api_call
Allerdings, wenn ich versuchen Sie es erneut um den Test auszuführen, habe ich diesen Fehler:
Failure/Error: VCR.use_cassette("#{provider_name}_mail_dispatcher_points_already_awarded", record: :all) do
URI::InvalidURIError:
bad URI(is not URI?): https://<DOMAIN>:<PASSWORD>@services.someprovider.com:443/enterprise/composite/some_api_call
# ./spec/models/mail_dispatcher_spec.rb:130:in `block (3 levels) in <top (required)>'
Dies steht im Widerspruch zu der obige Absatz aus der Dokumentation. Was mache ich falsch?
Vielen Dank im Voraus für jede Hilfe.
Louise