Skip to content

Commit

Permalink
Merge pull request #146 from projecthydra/145-raw-image-spec
Browse files Browse the repository at this point in the history
Fix 'attach RAW image' specs
  • Loading branch information
cjcolvar committed Apr 4, 2017
2 parents 037a26b + 5d1f705 commit 818d5f7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions spec/units/transcoding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def create_derivatives(_filename)
when 'image/x-adobe-dng'
ImageDerivatives.create(self, source: :original_file,
outputs: [
{ label: :access, size: "300x300>", format: 'jpg', processor: :raw_image },
{ label: :thumb, size: "100x100>", format: 'jpg', processor: :raw_image }])
{ label: :access, size: "300x300>", format: 'jpg', processor: :raw_image, url: "#{uri}/original_file_access" },
{ label: :thumb, size: "100x100>", format: 'jpg', processor: :raw_image, url: "#{uri}/original_file_thumb" }])
end
end
end
Expand Down Expand Up @@ -113,14 +113,15 @@ def create_derivatives(_filename)
end

it "transcodes" do
expect(file.attached_files.key?('access')).to be_falsey
expect(file.attached_files.key?('thumb')).to be_falsey
expect(file.attached_files.key?('original_file_access')).to be_falsey
expect(file.attached_files.key?('original_file_thumb')).to be_falsey

file.create_derivatives(filename)
expect(file.attached_files['access']).to have_content
expect(file.attached_files['access'].mime_type).to eq('image/jpeg')
expect(file.attached_files['thumb']).to have_content
expect(file.attached_files['thumb'].mime_type).to eq('image/jpeg')
file.reload
expect(file.attached_files['original_file_access']).to have_content
expect(file.attached_files['original_file_access'].mime_type).to eq('image/jpeg')
expect(file.attached_files['original_file_thumb']).to have_content
expect(file.attached_files['original_file_thumb'].mime_type).to eq('image/jpeg')
end
end

Expand Down

0 comments on commit 818d5f7

Please sign in to comment.