Skip to content

Commit

Permalink
pres copy status enum: rename expected_version_not_found_online to ex…
Browse files Browse the repository at this point in the history
…pected_version_not_found_on_storage (more general, more accurate)
  • Loading branch information
jmartin-sul committed Dec 6, 2017
1 parent 9d7abe6 commit 17ed5e5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/preserved_copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PreservedCopy < ApplicationRecord
invalid_moab: 1,
invalid_checksum: 2,
online_moab_not_found: 3,
expected_version_not_found_online: 4,
expected_version_not_found_on_storage: 4,
fixity_check_failed: 5
}

Expand Down
2 changes: 1 addition & 1 deletion app/services/preserved_object_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def confirm_version_on_db_object(db_object, version_symbol)
results.concat(increase_version(db_object))
else
# TODO: needs manual intervention until automatic recovery services implemented
results.concat(update_status(db_object, 'expected_version_not_found_online')) if db_object.is_a?(PreservedCopy)
results.concat(update_status(db_object, 'expected_version_not_found_on_storage')) if db_object.is_a?(PreservedCopy)
results << result_hash(ARG_VERSION_LESS_THAN_DB_OBJECT, db_object.class.name)
end
results.concat(update_db_object(db_object))
Expand Down
2 changes: 1 addition & 1 deletion spec/models/preserved_copy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
invalid_moab: 1,
invalid_checksum: 2,
online_moab_not_found: 3,
expected_version_not_found_online: 4,
expected_version_not_found_on_storage: 4,
fixity_check_failed: 5
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/services/preserved_object_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
let(:updated_po_db_timestamp_msg) { "#{exp_msg_prefix} PreservedObject updated db timestamp only" }
let(:updated_pc_db_obj_msg) { "#{exp_msg_prefix} PreservedCopy db object updated" }
let(:updated_pc_db_status_msg) do
"#{exp_msg_prefix} PreservedCopy status changed from ok to expected_version_not_found_online"
"#{exp_msg_prefix} PreservedCopy status changed from ok to expected_version_not_found_on_storage"
end

it "entry version stays the same" do
Expand Down
6 changes: 3 additions & 3 deletions spec/services/preserved_object_handler_update_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
version: po.current_version,
size: 1,
endpoint: ep,
status: 'expected_version_not_found_online'
status: 'expected_version_not_found_on_storage'
)
end

Expand Down Expand Up @@ -62,9 +62,9 @@
end
it 'does not update status of PreservedCopy' do
# TODO: not clear what to do here; it's not 'ok' if we didn't validate ...
expect(pc.status).to eq 'expected_version_not_found_online'
expect(pc.status).to eq 'expected_version_not_found_on_storage'
po_handler.update_version
expect(pc.reload.status).to eq 'expected_version_not_found_online'
expect(pc.reload.status).to eq 'expected_version_not_found_on_storage'
end
it 'does not update PreservedCopy last_audited field' do
orig_timestamp = pc.last_audited
Expand Down

0 comments on commit 17ed5e5

Please sign in to comment.