Skip to content

Commit

Permalink
Fixed 2 failing specs. Related to previous commit for story #618.
Browse files Browse the repository at this point in the history
One of the specs needed to be updated because of the code changes in the
previous commit.  The other spec revealed an existing problem with loss
of state due to differing in-memory objects.  That problem was solved by
adding inverse_of to the association.
  • Loading branch information
val99erie committed Dec 20, 2017
1 parent bbd2da6 commit 5638031
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/xml_import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class XmlImport < ApplicationRecord # rubocop:disable Metrics/ClassLength
##
# @!attribute batch [rw]
# @return [Batch]
has_one :batch, as: :batchable
has_one :batch, as: :batchable, inverse_of: :batchable

##
# @!method record?
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/tufts/import_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
end

it 'normalized metadata fields' do
expect(record.fields.to_a[1]).to eq([:abstract, ["Another long description with \n plenty\n of whitespace"]])
expect(record.fields.to_a).to include([:abstract, ["Another long description with \n plenty\n of whitespace"]])
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions spec/presenters/xml_import_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
.create(:hyrax_uploaded_file, file: File.open(file_fixture('2.pdf')))
end

# 999 This spec is failing
it 'changes to queued' do
optional 'Sometimes fails on travis' if ENV['TRAVIS']
expect { import.batch.enqueue! }
.to change { presenter.status }
.to('Queued')
Expand Down

0 comments on commit 5638031

Please sign in to comment.