Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydra::Works::AddFileToFileSet #find_or_create_file_for_rdf_uri fails to create original_file association #369

Open
elrayle opened this issue Jun 21, 2019 · 0 comments
Labels

Comments

@elrayle
Copy link
Contributor

elrayle commented Jun 21, 2019

Descriptive summary

AddFileToFileSet is supposed to be able to process the use the file is playing in the fileset as either a symbol or a URI. But the code in the two methods that create the file through ActiveFedora are not equivalent. The find_or_create_file_for_rdf_uri method fails to create the original_file association which is needed to be able to reference the file from the fileset using the_file_set.original_file.

Expected behavior

Whether calling AddToFileSet with type as URI or symbol, it is expected that after the add, there will be an association method that can be used to access the file in the fileset.

the_file_set.original_file # is defined and returns the File

Actual behavior

the_file_set.original_file # raises method not found for original_file

find_or_create_file_for_symbol correctly creates original_file association

find_or_create_file_for_rdf_uri fails to create original_file association

Steps to reproduce the behavior

  let(:file_set) { Hydra::Works::FileSet.new }
  let(:type)  { RDF::URI.new('http://pcdm.org/use#originalFile') }
  let(:file)                { File.open(File.join(fixture_path, filename)) }

    it 'adds association method' do
      described_class.call(file_set, file, type)
      expect(file_set).to respond_to :original_file
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Status: Backlog
Development

No branches or pull requests

1 participant