Skip to content

Commit 3a20690

Browse files
authored
Digital Object Create Assessment (#69)
1 parent b23e799 commit 3a20690

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: Digital Object create Assessment
2+
Background:
3+
Given an administrator user is logged in
4+
And a Digital Object has been created
5+
And the Digital Object is opened in edit mode
6+
Scenario: Assessment form is prefilled with Digital Object title
7+
When the user clicks on 'More'
8+
And the user clicks on 'Create Assessment'
9+
Then the New Assessment page is displayed
10+
And the Assessment is linked to the Digital Object in the 'Basic Information' form

staff_features/digital_objects/step_definitions/digital_object_shared.rb

+13
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,16 @@
157157
expect(current_url).to eq "#{PUBLIC_URL}/repositories/#{@repository_id}/digital_objects/#{@digital_object_id}"
158158
expect(page).to have_text "Digital Object Title #{@uuid}"
159159
end
160+
161+
Then 'the Assessment is linked to the Digital Object in the {string} form' do |form_title|
162+
section_title = find('h3', text: form_title)
163+
section = section_title.ancestor('section')
164+
expect(section[:id]).to_not eq nil
165+
166+
related_accessions_elements = section.all('li.token-input-token')
167+
168+
expect(related_accessions_elements.length).to eq 1
169+
related_accession = related_accessions_elements[0].find('.digital_object')
170+
171+
expect(related_accession[:'data-content']).to include "digital_objects/#{@digital_object_id}"
172+
end

0 commit comments

Comments
 (0)