Sha256: d7511d354aecaac1586d1d1b24b77f0d40289aa4c30ef89a64ffbbc656e2e1fa

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

require "refile/test_app"

feature "single attribute form upload" do
  scenario "upload a single file insteaf of an array of files" do
    visit "/single/posts/new"
    fill_in "Title", with: "A cool post"
    attach_file "Documents", path("hello.txt")
    click_button "Create"

    expect(download_link("Document: hello.txt")).to eq("hello")
  end

  scenario "Edit with changes" do
    visit "/single/posts/new"
    fill_in "Title", with: "A cool post"
    attach_file "Documents", path("hello.txt")
    click_button "Create"

    visit "/single/posts/#{Post.last.id}/edit"
    attach_file "Documents", path("monkey.txt")
    click_button "Update"

    expect(download_link("Document: monkey.txt")).to eq("monkey")
    expect(page).not_to have_link("Document: hello.txt")
  end

  scenario "Edit without changes" do
    visit "/single/posts/new"
    fill_in "Title", with: "A cool post"
    attach_file "Documents", path("hello.txt")
    click_button "Create"

    visit "/single/posts/#{Post.last.id}/edit"
    click_button "Update"

    expect(download_link("Document: hello.txt")).to eq("hello")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
leifcr-refile-0.7.3 spec/refile/features/single_upload_spec.rb
leifcr-refile-0.7.1 spec/refile/features/single_upload_spec.rb
leifcr-refile-0.7.0 spec/refile/features/single_upload_spec.rb