This repository has been archived by the owner on Jan 5, 2021. It is now read-only.
-
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 alternate ids to specify collection membership
When importing works from csv, we want to be able to use the library-specific identifier as well as the internal Valkyrie one.
- Loading branch information
Showing
6 changed files
with
99 additions
and
10 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
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
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,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe Validation::Member, type: :model do | ||
describe '#exists?' do | ||
context 'with an id' do | ||
subject { described_class.new(collection.id.to_s) } | ||
|
||
let(:collection) { create(:archival_collection) } | ||
|
||
its(:exists?) { is_expected.to be(true) } | ||
end | ||
|
||
context 'with an alternate id' do | ||
subject { described_class.new(collection.alternate_ids.first.to_s) } | ||
|
||
let(:collection) { create(:archival_collection, alternate_ids: ['xyz_1234']) } | ||
|
||
its(:exists?) { is_expected.to be(true) } | ||
end | ||
|
||
context 'with neither a non-existent id' do | ||
subject { described_class.new('non-existent-id') } | ||
|
||
its(:exists?) { is_expected.to be(false) } | ||
end | ||
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