docbrown/spec/support/initializers/vcr.rb
rhymes f2b0be2043
Add Slack messengers: part 2 (#6916)
* Add Slack::Messengers::ArticlePublished

* Add Slack::Messengers::ReactionVomit

* Add Slack::Messengers::CommentUserWarned

* Add missing URL helpers

* Add Slack::Messengers::ArticleFetchedFeed

* Remove callback condition

* Build, don't create
2020-04-03 17:00:06 +02:00

37 lines
1.1 KiB
Ruby

require "vcr"
VCR.configure do |config|
config.cassette_library_dir = "spec/support/fixtures/vcr_cassettes"
config.hook_into :webmock
config.configure_rspec_metadata!
config.ignore_localhost = true
# tell VCR to ignore browsers download sites
# see <https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock>
config.ignore_hosts(
"chromedriver.storage.googleapis.com",
"github.com/mozilla/geckodriver/releases",
"selenium-release.storage.googleapis.com",
"developer.microsoft.com/en-us/microsoft-edge/tools/webdriver",
)
# Removes all private data (Basic Auth, Set-Cookie headers...)
config.before_record do |i|
i.response.headers.delete("Set-Cookie")
i.request.headers.delete("Authorization")
u = URI.parse(i.request.uri)
i.request.uri.sub!(/:\/\/.*#{Regexp.escape(u.host)}/, "://#{u.host}")
end
end
VCR_OPTIONS = {
twitter_fetch_status: {
cassette_name: "twitter_fetch_status",
allow_playback_repeats: true
},
rss_feeds: {
cassette_name: "rss_feeds",
allow_playback_repeats: true
}
}.freeze