-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1433 from projecthydra/redirect_after_upload
Redirect to upload_set#edit after upload
- Loading branch information
Showing
11 changed files
with
59 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
app/views/curation_concerns/file_sets/upload/_script_templates.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/views/curation_concerns/file_sets/upload/_tos_checkbox.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<label> | ||
<%= check_box_tag 'terms_of_service', 1, nil, {data: {activate: 'activate-submit'}} %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), '/agreement/', target: "_blank" %>.</strong> | ||
</label> | ||
<%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), '/agreement/', target: "_blank" %>.</strong> | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
require 'spec_helper' | ||
|
||
describe "Uploading files via web form", type: :feature do | ||
describe "Uploading files via web form", :js do | ||
include ActiveJob::TestHelper | ||
before do | ||
Capybara.default_max_wait_time = 60 | ||
sign_in :user | ||
click_link "Upload" | ||
end | ||
|
||
it "has an ingest screen" do | ||
it "puts them in the repository" do | ||
expect(page).to have_content "Select files" | ||
expect(page).to have_content "Start upload" | ||
expect(page).to have_content "Cancel upload" | ||
expect(page).to have_xpath '//input[@type="file"]' | ||
end | ||
|
||
context "the terms of service", :js do | ||
it "is required to be checked" do | ||
attach_file("file_set[files][]", File.dirname(__FILE__) + "/../../spec/fixtures/image.jp2", visible: false) | ||
attach_file("file_set[files][]", File.dirname(__FILE__) + "/../../spec/fixtures/jp2_fits.xml", visible: false) | ||
expect(page).to have_css("button#main_upload_start[disabled]") | ||
find('#main_upload_start_span').hover | ||
expect(page).to have_content "Please accept Deposit Agreement before you can upload." | ||
end | ||
attach_file("file_set[files][]", File.dirname(__FILE__) + "/../../spec/fixtures/image.jp2", visible: false) | ||
attach_file("file_set[files][]", File.dirname(__FILE__) + "/../../spec/fixtures/jp2_fits.xml", visible: false) | ||
expect(page).to have_css("button#main_upload_start[disabled]") | ||
find('#main_upload_start_span').hover | ||
expect(page).to have_content "Please accept Deposit Agreement before you can upload." | ||
|
||
check 'terms_of_service' | ||
|
||
click_button "Start upload" | ||
|
||
# This will take awhile because it's waiting for all files to upload and | ||
# a redirect to the upload_set edit page. | ||
expect(page).to have_content "Individual Titles" | ||
|
||
expect(page).to have_css("input[type='text'][value='image.jp2']") | ||
expect(page).to have_css("input[type='text'][value='jp2_fits.xml']") | ||
|
||
fill_in 'upload_set_creator', with: 'Gaius Julius Caesar IV' | ||
|
||
click_button "Save" | ||
|
||
expect(page).to have_content "Your files are being processed by Repository in the background." | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters