Skip to content

Commit 2a8112c

Browse files
Subject add external document
1 parent 0ff1dc5 commit 2a8112c

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

staff_features/subjects/step_definitions/subject_edit.rb

+13
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@
5252

5353
expect(elements.length).to eq 0
5454
end
55+
56+
Then 'a new External Document is added to the Subject with the following values' do |form_values_table|
57+
records = all('#subject_external_documents_ .subrecord-form-list li')
58+
59+
expect(records.length).to eq @subject_number_of_external_documents + 1
60+
61+
created_record = records.last
62+
63+
form_values_hash = form_values_table.rows_hash
64+
form_values_hash.each do |field, value|
65+
expect(created_record.find_field(field).value.downcase.gsub(' ', '_')).to eq value.downcase.gsub(' ', '_')
66+
end
67+
end

staff_features/subjects/step_definitions/subject_view.rb

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
select 'Art & Architecture Thesaurus', from: 'subject_source_'
88
select 'Cultural context', from: 'subject_terms__0__term_type_'
99

10+
@subject_number_of_external_documents = 0
11+
1012
click_on 'Save'
1113
expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Subject Created'
1214

staff_features/subjects/subject_add_external_document.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Subject External Documemt
99
And the user fills in 'Title' with 'Test title'
1010
And the user fills in 'Location' with 'Test location'
1111
And the user clicks on 'Save Subject'
12-
Then the 'Subject' updated message is displayed
12+
Then the 'Subject' saved message is displayed
1313
And a new External Document is added to the Subject with the following values
1414
| Title | Test title |
1515
| Location | Test location |

0 commit comments

Comments
 (0)