Sha256: 03172f868c1300f31783944758b2c1a1d3b97bfb41768ff8a45230620eb9b8ef

Contents?: true

Size: 871 Bytes

Versions: 6

Compression:

Stored size: 871 Bytes

Contents

require "refile/test_app"

feature "Direct HTTP post file uploads", :js do
  scenario "Successfully upload a file" do
    visit "/presigned/posts/new"
    fill_in "Title", with: "A cool post"
    attach_file "Document", path("hello.txt")

    expect(page).to have_content("Upload started")
    expect(page).to have_content("Upload complete token accepted")
    expect(page).to have_content("Upload success token accepted")

    click_button "Create"

    expect(page).to have_selector("h1", text: "A cool post")
    expect(download_link("Document")).to eq("hello")
  end

  scenario "Fail to upload a file that is too large" do
    visit "/presigned/posts/new"
    fill_in "Title", with: "A cool post"
    attach_file "Document", path("large.txt")

    expect(page).to have_content("Upload started")
    expect(page).to have_content("Upload failure too large")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
refile-0.5.5 spec/refile/features/presigned_upload_spec.rb
refile-0.5.4 spec/refile/features/presigned_upload_spec.rb
refile-0.5.3 spec/refile/features/presigned_upload_spec.rb
refile-0.5.2 spec/refile/features/presigned_upload_spec.rb
refile-0.5.1 spec/refile/features/presigned_upload_spec.rb
refile-0.5.0 spec/refile/features/presigned_upload_spec.rb