-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use MoabStorageService for controllers (#1237)
use MoabStorageService for controllers
- Loading branch information
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Responsibility: interactions with Moab storage to support read-only access for ReST API calls | ||
class MoabStorageService | ||
def self.retrieve_content_file_group(druid) | ||
Moab::StorageServices.retrieve_file_group('content', druid) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe MoabStorageService do | ||
let(:druid) { 'jj925bx9565' } | ||
|
||
describe '.retrieve_content_file_group' do | ||
it 'calls Moab::StorageServices.retrieve_file_group for "content"' do | ||
allow(Moab::StorageServices).to receive(:retrieve_file_group).with('content', druid) | ||
described_class.retrieve_content_file_group(druid) | ||
expect(Moab::StorageServices).to have_received(:retrieve_file_group).with('content', druid) | ||
end | ||
end | ||
end |