Sha256: 63d5096b9bc93039b828548cc1b047e9faf36b10372327b66e88fc64dabca74b

Contents?: true

Size: 591 Bytes

Versions: 10

Compression:

Stored size: 591 Bytes

Contents

require 'spec_helper'

describe 'hyrax/uploads/create.json.jbuilder' do
  let(:file) { double(filename: 'foo.jpg', size: 777) }
  let(:uploader) { instance_double(Hyrax::UploadedFileUploader, file: file) }
  let(:upload) { mock_model(Hyrax::UploadedFile, file: uploader) }

  before do
    assign(:upload, upload)
    render
  end

  it "renders json of the curation_concern" do
    json = JSON.parse(rendered).fetch('files').first
    expect(json['id']).to eq upload.id
    expect(json['name']).to eq 'foo.jpg'
    expect(json['deleteUrl']).to eq hyrax.uploaded_file_path(upload)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.1.0 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.5 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.4 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.3 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.2 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.1 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.0.rc2 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
hyrax-1.0.0.rc1 spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
test_hyrax-0.0.1.alpha spec/views/hyrax/uploads/create.json.jbuilder_spec.rb