Sha256: f7d93323183c6ae8fa83c1ed2e8940020b870efcbc1c885e41c33190fd42a8e0

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

require 'integration_spec_helper'

describe 'File upload' do

  if account?

    before(:all) do
      @storage = login
    end

    [12, 6_000, 2_000_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

6 entries across 6 versions & 1 rubygems

Version Path
rmega-0.3.2 spec/integration/file_upload_spec.rb
rmega-0.3.1 spec/integration/file_upload_spec.rb
rmega-0.2.7 spec/integration/file_upload_spec.rb
rmega-0.2.6 spec/integration/file_upload_spec.rb
rmega-0.2.5 spec/integration/file_upload_spec.rb
rmega-0.2.4 spec/integration/file_upload_spec.rb