Sha256: cd93ee203de86dbb740fb7ddc296444e2ac50a35fef2d03b1fad4e8ed396febd

Contents?: true

Size: 631 Bytes

Versions: 2

Compression:

Stored size: 631 Bytes

Contents

require 'integration_spec_helper'

describe 'File upload' do

  if account?

    before(:all) do
      @storage = login
    end

    [12, 6_000].each do |size|

      context "when a file (#{size} bytes) is uploaded" do

        let(:path) { "#{temp_folder}/testfile_#{SecureRandom.hex(6)}" }

        let(:content) { SecureRandom.random_bytes(size) }

        it 'is found' do
          File.write(path, content)
          file = @storage.root.upload(path)
          file = @storage.root.files.find { |f| f.handle == file.handle }
          file.delete
          expect(file).not_to be_nil
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmega-0.2.2 spec/integration/file_upload_spec.rb
rmega-0.2.1 spec/integration/file_upload_spec.rb