Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/altmedia.iml

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

1 change: 1 addition & 0 deletions app/models/bibliographic/host_bib_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class HostBibTask < ActiveRecord::Base
succeeded: 6,
failed: 9
}, default: :starting
validates :email, presence: true

class << self
def create_from!(file, email)
Expand Down
1 change: 1 addition & 0 deletions spec/data/calnet/013191303.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ extra:
uid: "013191303"
berkeleyEduIsMemberOf:
- cn=edu:berkeley:org:libr:framework:alma-admins,ou=campus groups,dc=berkeley,dc=edu
berkeleyEduAlternateId: ethomas@berkeley.edu
1 change: 1 addition & 0 deletions spec/data/calnet/013191305.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using an email of a former employee in LIT. I think they probably put it in there but not sure if we should still be using it. Looks like it's used in several places

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied that from the same identifier in spec/data/alma_patrons - I agree it's not ideal, but it was for testing purposes.

Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ extra:
uid: "013191305"
berkeleyEduIsMemberOf:
- cn=edu:berkeley:org:libr:framework:LIBR-framework-admins,ou=campus groups,dc=berkeley,dc=edu
berkeleyEduAlternateId: ethomas@berkeley.edu
2 changes: 1 addition & 1 deletion spec/lib/bibliographic/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bibliographic
RSpec.describe Report do
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt') }
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt', email: 'test@test.example') }
let(:report) { described_class.new(host_bib_task, 6) }

# succeed mmsids for csv content
Expand Down
18 changes: 17 additions & 1 deletion spec/models/host_bib_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RSpec.describe Bibliographic::HostBib, type: :model do
let(:record_id) { double('record_id') }
let(:mms_id) { '991083840969706532' }
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt') }
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt', email: 'test@test.example') }
let(:marc_stub) { instance_double(MARC::Record) }
let(:expected_subfields) { { 'w' => '991083840969706532', 't' => 'Seconde partie du discours aux Welches ' } }

Expand Down Expand Up @@ -42,6 +42,22 @@ def marc_stub
end
end

describe 'task creation' do
context 'without an email address' do
it 'is invalid' do
task = Bibliographic::HostBibTask.new(filename: 'fake.txt', email: nil)
expect(task).not_to be_valid
end
end

context 'with an email address' do
it 'is valid' do
task = Bibliographic::HostBibTask.new(filename: 'fake.txt', email: 'test@test.example')
expect(task).to be_valid
end
end
end

context 'host_bib not nil' do
it_behaves_like 'host_bib has alma marc', 'pending'
it_behaves_like 'host_bib has alma marc', 'retrieving'
Expand Down
2 changes: 1 addition & 1 deletion spec/models/linked_bib_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

RSpec.describe Bibliographic::LinkedBib, type: :model do
let(:mms_id) { '991083840969706532' }
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt') }
let(:host_bib_task) { Bibliographic::HostBibTask.create(filename: 'fake.txt', email: 'test@test.example') }
let(:host_bib) { host_bib_task.host_bibs.create(mms_id:) }
let(:subfields_from_774) { { 'w' => '991083840969706532', 't' => 'Seconde partie du discours aux Welches ' } }

Expand Down