Sha256: 004278316548a746c776e726ad25404ffb71b1a65dacfe1eccdfa2e9cf33dd70

Contents?: true

Size: 809 Bytes

Versions: 16

Compression:

Stored size: 809 Bytes

Contents

require 'spec_helper'

describe IngestLocalFileJob do
  let(:user) { create(:user) }

  let(:file_set) { FileSet.new }
  let(:file_set_id) { 'abc123' }
  let(:actor) { double }

  let(:mock_upload_directory) { 'spec/mock_upload_directory' }

  before do
    Dir.mkdir mock_upload_directory unless File.exist? mock_upload_directory
    FileUtils.copy(File.expand_path('../../fixtures/world.png', __FILE__), mock_upload_directory)
    allow(FileSet).to receive(:find).with(file_set_id).and_return(file_set)
    allow(CurationConcerns::FileSetActor).to receive(:new).with(file_set, user).and_return(actor)
  end

  it 'has attached a file' do
    expect(actor).to receive(:create_content).and_return(true)
    described_class.perform_now(file_set_id, mock_upload_directory, 'world.png', user.user_key)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
curation_concerns-0.12.0.pre5 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.12.0.pre4 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.12.0.pre3 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.12.0.pre2 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.12.0.pre1 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.11.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.11.0.rc1 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.10.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.9.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.8.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.7.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.6.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.5.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.4.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.3.0 spec/jobs/ingest_local_file_job_spec.rb
curation_concerns-0.2.0 spec/jobs/ingest_local_file_job_spec.rb