From 41f9f143c5a2332df4fe2c1c88daa57c2831a278 Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Sat, 30 Mar 2024 14:49:55 -0400 Subject: [PATCH 1/2] WIP set up vcr --- Gemfile | 2 ++ Gemfile.lock | 11 +++++++++++ spec/rails_helper.rb | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/Gemfile b/Gemfile index 8b4dcc59..46efd6ce 100644 --- a/Gemfile +++ b/Gemfile @@ -89,6 +89,8 @@ group :development, :test do # gem 'rubocop' gem 'rubocop' gem 'rubocop-rspec' + gem 'vcr' + gem 'webmock' end gem 'clamav-client' diff --git a/Gemfile.lock b/Gemfile.lock index ae4f2bc7..a2943c1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -207,6 +207,9 @@ GEM deep_merge (~> 1.2, >= 1.2.1) ostruct connection_pool (2.4.1) + crack (1.0.0) + bigdecimal + rexml crass (1.0.6) csv (3.3.0) database_cleaner (2.1.0) @@ -364,6 +367,7 @@ GEM haml (5.2.2) temple (>= 0.8.0) tilt + hashdiff (1.1.0) hashie (3.6.0) hiredis (0.6.3) htmlentities (4.3.4) @@ -1017,6 +1021,7 @@ GEM unicode-display_width (2.6.0) unicode-types (1.10.0) validatable (1.6.7) + vcr (6.1.0) version_gem (1.1.4) warden (1.2.9) rack (>= 2.0.9) @@ -1025,6 +1030,10 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) + webmock (3.23.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) websocket (1.2.11) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) @@ -1108,7 +1117,9 @@ DEPENDENCIES turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) + vcr web-console (>= 3.3.0) + webmock willow_sword! BUNDLED WITH diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c24dbeae..9f8b9cd7 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -6,6 +6,8 @@ abort("The Rails environment is running in production mode!") if Rails.env.production? require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! +require 'webmock/rspec' +require 'vcr' # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are @@ -79,3 +81,9 @@ end end + +VCR.configure do |config| + config.cassette_library_dir = "spec/fixtures/vcr_cassettes" + config.hook_into :webmock + config.allow_http_connections_when_no_cassette = true +end From 9a56043194459c84fe7b8a190d16a8cd5b5cbf84 Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Sat, 30 Mar 2024 15:00:20 -0400 Subject: [PATCH 2/2] WIP stub entries for specs --- spec/controllers/archive_controller_spec.rb | 4 ++++ spec/models/archive_file_spec.rb | 4 ++++ spec/models/archive_file_worker_spec.rb | 4 ++++ spec/presenters/hyrax/ds_file_set_presenter_spec.rb | 6 ++++++ 4 files changed, 18 insertions(+) create mode 100644 spec/controllers/archive_controller_spec.rb create mode 100644 spec/models/archive_file_spec.rb create mode 100644 spec/models/archive_file_worker_spec.rb create mode 100644 spec/presenters/hyrax/ds_file_set_presenter_spec.rb diff --git a/spec/controllers/archive_controller_spec.rb b/spec/controllers/archive_controller_spec.rb new file mode 100644 index 00000000..358cd6ee --- /dev/null +++ b/spec/controllers/archive_controller_spec.rb @@ -0,0 +1,4 @@ +require 'rails_helper' + +RSpec.describe ArchiveController do +end diff --git a/spec/models/archive_file_spec.rb b/spec/models/archive_file_spec.rb new file mode 100644 index 00000000..4d45621a --- /dev/null +++ b/spec/models/archive_file_spec.rb @@ -0,0 +1,4 @@ +require 'rails_helper' + +RSpec.describe ArchiveFile, type: :model do +end diff --git a/spec/models/archive_file_worker_spec.rb b/spec/models/archive_file_worker_spec.rb new file mode 100644 index 00000000..e2e42049 --- /dev/null +++ b/spec/models/archive_file_worker_spec.rb @@ -0,0 +1,4 @@ +require 'rails_helper' + +RSpec.describe ArchiveFileWorker, type: :model do +end diff --git a/spec/presenters/hyrax/ds_file_set_presenter_spec.rb b/spec/presenters/hyrax/ds_file_set_presenter_spec.rb new file mode 100644 index 00000000..72e858da --- /dev/null +++ b/spec/presenters/hyrax/ds_file_set_presenter_spec.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Hyrax::DsFileSetPresenter do +end