Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/admin/urn_lists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def create
if @urn_list.save
UrnListImporterJob.perform_later(@urn_list)

return redirect_to admin_urn_lists_path
redirect_to admin_urn_lists_path
end

render action: :new
rescue ActionController::ParameterMissing
redirect_to new_admin_urn_list_path, alert: 'Please choose a file to upload'
end

def download
Expand Down
10 changes: 10 additions & 0 deletions spec/features/admin_can_upload_urn_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@

expect(UrnListImporterJob).to have_been_enqueued
end

context 'without attaching a file' do
scenario 'displays an error' do
visit new_admin_urn_list_path

click_button 'Upload'

expect(page).to have_text 'Please choose a file to upload'
end
end
end
Loading