-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resource generate bulk spreadsheet (#47)
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
staff_features/resources/resource_generate_bulk_spreadsheet.feature
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Feature: Resource generate bulk spreadsheet | ||
Background: | ||
Given an administrator user is logged in | ||
And a Resource has been created | ||
And the Resource is opened in edit mode | ||
Scenario: Resource Bulk archival object updater page is displayed | ||
When the user clicks on 'More' | ||
And the user clicks on 'Generate Bulk Archival Object Spreadsheet' | ||
Then the Generate Bulk Archival Object Spreadsheet page is displayed | ||
Scenario: Resource Bulk Archival Object Spreadsheet is downloaded | ||
Given the user is on the Generate Bulk Archival Object Spreadsheet page | ||
When the user selects the Archival Object | ||
And the user clicks on 'Download Spreadsheet' | ||
Then the Bulk Update Resource spreadsheet is downloaded |
29 changes: 29 additions & 0 deletions
29
staff_features/resources/step_definitions/resource_generate_bulk_spreadsheet.rb
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
Given 'the user is on the Generate Bulk Archival Object Spreadsheet page' do | ||
click_on 'More' | ||
click_on 'Generate Bulk Archival Object Spreadsheet' | ||
end | ||
|
||
Then 'the Generate Bulk Archival Object Spreadsheet page is displayed' do | ||
expect(current_url).to include 'bulk_archival_object_updater/download?resource=' | ||
expect(current_url).to include @resource_id | ||
end | ||
|
||
Then 'the user selects the Archival Object' do | ||
input_fields = all('#bulk_archival_object_updater_table input') | ||
|
||
expect(input_fields.length).to eq 2 | ||
input_fields[1].click | ||
end | ||
|
||
Then 'the Bulk Update Resource spreadsheet is downloaded' do | ||
files = Dir.glob(File.join(Dir.tmpdir, '*.xlsx')) | ||
|
||
downloaded_file = nil | ||
files.each do |file| | ||
downloaded_file = file if file.include?("bulk_update.resource_#{@resource_id}") | ||
end | ||
|
||
expect(downloaded_file).to_not eq nil | ||
end |