Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1464 from pgwillia/1463_vcr_for_external_services
Browse files Browse the repository at this point in the history
Use vcr for external services
  • Loading branch information
pgwillia authored Jan 17, 2019
2 parents eade1cd + 486fefc commit d9f807e
Show file tree
Hide file tree
Showing 9 changed files with 580 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ group :test do

gem 'selenium-webdriver'

gem 'vcr', require: false
gem 'webmock', require: false

# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
11 changes: 11 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ GEM
rails-i18n (>= 4.0.0)
sass-rails (>= 4.0.3)
concurrent-ruby (1.1.4)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.4)
daemons (1.3.1)
debug_inspector (0.0.3)
Expand Down Expand Up @@ -158,6 +160,7 @@ GEM
haml (>= 4.0.6, < 6.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
hashdiff (0.3.8)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
Expand Down Expand Up @@ -321,6 +324,7 @@ GEM
ruby_parser (3.12.0)
sexp_processor (~> 4.9)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.7.2)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand Down Expand Up @@ -380,8 +384,13 @@ GEM
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
vcr (4.0.0)
warden (1.2.7)
rack (>= 1.0)
webmock (3.5.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
xml-simple (1.1.5)
xpath (2.1.0)
nokogiri (~> 1.3)
Expand Down Expand Up @@ -433,6 +442,8 @@ DEPENDENCIES
spring
turbolinks (= 5.2.0)
uglifier (>= 1.3.0)
vcr
webmock
xpath (= 2.1.0)

BUNDLED WITH
Expand Down
217 changes: 217 additions & 0 deletions fixtures/vcr_cassettes/holdings_with_links.yml

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions fixtures/vcr_cassettes/item_result.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions spec/blacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require 'active_support/inflector'
require 'capybara/rspec'
require 'capybara/rails'
require 'vcr'
require 'webmock/rspec'
require_relative '../lib/ingest/dublin_core_om'
require_relative '../lib/ingest/peel_mods_om'
require_relative '../lib/ingest/databases'
Expand Down
6 changes: 4 additions & 2 deletions spec/features/catalog_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
end

scenario 'User visits an item result' do
visit 'catalog/1001523'
expect(page).to have_text('Shakespeare: a historical and critical study with annotated texts of twenty-one plays')
VCR.use_cassette('item_result') do
visit 'catalog/1001523'
expect(page).to have_text('Shakespeare: a historical and critical study with annotated texts of twenty-one plays')
end
end
end
Loading

0 comments on commit d9f807e

Please sign in to comment.