Skip to content

Commit 28caac4

Browse files
Concrete check of original values
1 parent c39d567 commit 28caac4

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

staff_features/accessions/accession_edit.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature: Accession Edit
2626
Given the Accession is opened in edit mode
2727
When the user changes the 'Title' field
2828
And the user clicks on 'Revert Changes'
29-
Then the 'Title' field has the original value
29+
Then the Accession Title field has the original value
3030
Scenario: Accession update fails due to invalid date input
3131
Given the Accession is opened in edit mode
3232
When the user fills in 'Date' with '2024-13-15'
@@ -54,4 +54,4 @@ Feature: Accession Edit
5454
And the user clicks on 'Save'
5555
Then the following error message is displayed
5656
| Identifier - Property is required but was missing |
57-
And the Identifier field has the original value
57+
And the Accession Identifier field has the original value

staff_features/accessions/step_definitions/accession_edit.rb

+7-13
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@
6161
click_on 'Edit'
6262
end
6363

64-
When 'the user changes the {string} field to {string}' do |field, value|
65-
fill_in field, with: value
66-
end
67-
68-
When 'the user changes the {string} field' do |field|
69-
fill_in field, with: "#{SecureRandom.uuid}"
70-
end
71-
72-
Then 'the {string} field has the original value' do |field|
73-
expect(page).to have_field(field, with: "Accession Title #{@uuid}")
74-
end
75-
7664
Then 'the Accession is updated with the new {string} as {string}' do |field, value|
7765
fill_in field, with: value
7866
end
@@ -93,13 +81,19 @@
9381
expect(page).to have_field(field, with: value)
9482
end
9583

84+
Then 'the Accession Title field has the original value' do
85+
visit "#{STAFF_URL}/accessions/#{@accession_id}/edit"
86+
87+
expect(page).to have_field('Title', with: "Accession Title #{@uuid}")
88+
end
89+
9690
Then 'the Accession Date field has the original value' do
9791
visit "#{STAFF_URL}/accessions/#{@accession_id}/edit"
9892

9993
expect(page).to have_field('Accession Date', with: '2000-01-01')
10094
end
10195

102-
When 'the Identifier field has the original value' do
96+
When 'the Accession Identifier field has the original value' do
10397
visit "#{STAFF_URL}/accessions/#{@accession_id}/edit"
10498

10599
expect(page).to have_field('Identifier', with: "Accession #{@uuid}")

staff_features/shared/step_definitions.rb

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
check label
4848
end
4949

50+
When 'the user changes the {string} field to {string}' do |field, value|
51+
fill_in field, with: value
52+
end
53+
54+
When 'the user changes the {string} field' do |field|
55+
fill_in field, with: "#{SecureRandom.uuid}"
56+
end
57+
5058
Then 'the {string} message is displayed' do |string|
5159
expect(page).to have_text string
5260
end

0 commit comments

Comments
 (0)