Last active
November 9, 2015 21:03
-
-
Save elrayle/cfa15bb3be8fb726317c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| describe 'upload files to collection', :js do | |
| it "preselects the collection we are uploading files to" do | |
| attach_file('files[]', File.dirname(__FILE__) + '/../../spec/fixtures/image.jp2') | |
| attach_file('files[]', File.dirname(__FILE__) + '/../../spec/fixtures/jp2_fits.xml') | |
| expect(page).to have_css('button#main_upload_start[disabled]') | |
| first(:checkbox, 'terms_of_service').click | |
| expect(page).to have_css('button#main_upload_start') | |
| click_button 'main_upload_start' | |
| expect(page).to have_css('button#main_upload_start') # passes and shouldn't - means it is still on the upload page | |
| expect(page).to have_css('button#upload_submit') # fails and shouldn't - means it didn't go to the metadata entry page | |
| fill_in('generic_file[tag][]', with: 'Test') | |
| click_button 'upload_submit' | |
| updated_collection = Collection.find(collection1.id) | |
| expect(updated_collection.member_ids).to eq ['test_1','test_2','test_3'] | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interactively, you will stay on the upload page when you click 'main_upload_button' (aka Start Upload) if no files are selected.
I confirmed that both attach_file statements work be testing...
This confirms that files[] is a valid field and that the two files are valid.
What I am not sure of is whether the files need to be set elsewhere in addition to files[] or some other indicator to be set for Start upload to execute properly.