Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
Making the test less dependant on the Display Name in the data dictio…
Browse files Browse the repository at this point in the history
…nary
  • Loading branch information
carolyncole committed Apr 4, 2019
1 parent 040d136 commit d02d0d1
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 32 deletions.
10 changes: 5 additions & 5 deletions spec/blacklight/catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@

# Check facets
within('div.blacklight-home_collection_id_ssim') do
expect(page).to have_selector('h3', text: 'Collection')
expect(page).to have_selector('h3[data-target="#facet-home_collection_id_ssim"]')
expect(page).to have_link('Searching Collection')
end
within('div.blacklight-work_type_ssim') do
expect(page).to have_selector('h3', text: 'Resource Type')
expect(page).to have_selector('h3[data-target="#facet-work_type_ssim"]')
expect(page).to have_link('Generic')
end
within('div.blacklight-collection_type_ssim') do
expect(page).to have_selector('h3', text: 'Collection Type')
expect(page).to have_selector('h3[data-target="#facet-collection_type_ssim"]')
expect(page).to have_link('Archival Collection')
end
within('div.blacklight-generic_field_ssim') do
expect(page).to have_selector('h3', text: 'Generic Field')
expect(page).to have_selector('h3[data-target="#facet-generic_field_ssim"]')
expect(page).to have_link('Faceted Value')
end
within('div.blacklight-creator_role_ssim') do
expect(page).to have_selector('h3', text: 'Role')
expect(page).to have_selector('h3[data-target="#facet-creator_role_ssim"]')
expect(page).to have_link('blasting')
end

Expand Down
4 changes: 2 additions & 2 deletions spec/cho/collection/archival_collections/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
end
within('div.documents-list') do
expect(page).to have_link('Archival collection index view')
expect(page).to have_blacklight_label('title_tesim').with('Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('Archival collection index view')
expect(page).to have_blacklight_label('collection_type_ssim').with('Collection Type')
expect(page).to have_blacklight_label('collection_type_ssim')
expect(page).to have_blacklight_field('collection_type_ssim').with('Archival Collection')
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/cho/collection/curated_collections/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
end
within('div.documents-list') do
expect(page).to have_link('Curated collection index view')
expect(page).to have_blacklight_label('title_tesim').with('Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('Curated collection index view')
expect(page).to have_blacklight_label('collection_type_ssim').with('Collection Type')
expect(page).to have_blacklight_label('collection_type_ssim')
expect(page).to have_blacklight_field('collection_type_ssim').with('Curated Collection')
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/cho/collection/library_collections/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
end
within('div.documents-list') do
expect(page).to have_link('Library collection index view')
expect(page).to have_blacklight_label('title_tesim').with('Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('Library collection index view')
expect(page).to have_blacklight_label('collection_type_ssim').with('Collection Type')
expect(page).to have_blacklight_label('collection_type_ssim')
expect(page).to have_blacklight_field('collection_type_ssim').with('Library Collection')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/cho/work/file_set/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
visit(polymorphic_path([:solr_document], id: file_set.id))
expect(page).to have_content 'Part of: Sample Generic Work'
within('div#document') do
expect(page).to have_blacklight_label('title_tesim').with('Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('Original File Name')
end
expect(page).to have_selector('h2', text: 'Files')
Expand Down
2 changes: 1 addition & 1 deletion spec/cho/work/import/create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
expect(page).to have_selector('td', text: 'work1_00002_02')
expect(page).to have_content("Work type can't be blank")
expect(page).to have_content("Object title can't be blank")
expect(page).to have_content('Collection missing_alt_id does not exist')
expect(page).to have_content(/missing_alt_id does not exist/)
expect(page).to have_content("Creator role 'http://id.loc.gov/vocabulary/relators/asdf' does not exist")
expect(page).to have_content("Creator agent 'Person, Missing' does not exist")
expect(page).to have_content("Creator agent 'Guy, Bad' does not exist")
Expand Down
6 changes: 3 additions & 3 deletions spec/cho/work/submissions/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
fill_in(:q, with: 'Work Index View')
click_button('Search')
within('div#documents') do
expect(page).to have_blacklight_label('title_tesim').with('Object Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('Work Index View')
expect(page).to have_blacklight_label('work_type_ssim').with('Resource Type')
expect(page).to have_blacklight_label('work_type_ssim')
expect(page).to have_blacklight_field('work_type_ssim').with('Generic')
expect(page).to have_blacklight_label('home_collection_id_tesim').with('Collection')
expect(page).to have_blacklight_label('home_collection_id_tesim')
expect(page).to have_blacklight_field('home_collection_id_tesim').with('Library Collection')
expect(page).to have_link('Library Collection')
end
Expand Down
21 changes: 10 additions & 11 deletions spec/cho/work/submissions/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@
click_button('Create Resource')
expect(page).to have_selector('h1', text: 'New Title')
within('#document') do
expect(page).to have_blacklight_label(:title_tesim, 'Object Title')
expect(page).to have_blacklight_label(:title_tesim)
expect(page).to have_blacklight_field(:title_tesim, 'New Title')
expect(page).to have_blacklight_label(:subtitle_tesim, 'Subtitle')
expect(page).to have_blacklight_label(:subtitle_tesim)
expect(page).to have_blacklight_field(:subtitle_tesim, 'New subtitle')
expect(page).to have_blacklight_label(:description_tesim, 'Description')
expect(page).to have_blacklight_label(:description_tesim)
expect(page).to have_blacklight_field(:description_tesim, 'Description of new generic work')
expect(page).to have_blacklight_label(:created_tesim, 'Created')
expect(page).to have_blacklight_label(:created_tesim)
expect(page).to have_blacklight_field(:created_tesim, 'datetime-2018-10-22T00:00:00.000Z')
expect(page).to have_blacklight_label(:generic_field_tesim, 'Generic Field')
expect(page).to have_blacklight_label(:generic_field_tesim)
expect(page).to have_blacklight_field(:generic_field_tesim, 'Sample generic field value')
expect(page).to have_blacklight_label(:alternate_ids_tesim, 'Identifier')
expect(page).to have_blacklight_label(:alternate_ids_tesim)
expect(page).to have_blacklight_field(:alternate_ids_tesim, 'id-asdf_1234')
expect(page).to have_blacklight_label(:work_type_ssim, 'Resource Type')
expect(page).to have_blacklight_label(:work_type_ssim)
expect(page).to have_blacklight_field(:work_type_ssim, 'Generic')
expect(page).to have_blacklight_label(:home_collection_id_tesim, 'Member of Collection')
expect(page).to have_blacklight_label(:home_collection_id_tesim)
expect(page).to have_blacklight_field(:home_collection_id_tesim, 'Sample Collection')
expect(page).to have_blacklight_field(:home_collection_id_tesim, archival_collection.id)
expect(page).to have_link('Sample Collection')
expect(page).to have_blacklight_label(:creator_tesim, 'Creator')
expect(page).to have_blacklight_label(:creator_tesim)
expect(page).to have_blacklight_field(:creator_tesim, 'Christopher Kringle (climbing)')
end
expect(page).to have_link('Edit')
Expand All @@ -67,8 +67,7 @@
click_button('Create Resource')
within('.error-explanation') do
expect(page).to have_selector('h2', text: '2 errors prohibited this resource from being saved:')
expect(page).to have_content("Object title can't be blank")
expect(page).to have_content("Collection can't be blank")
expect(page).to have_css('ul li', text: "can't be blank", count: 2)
end
fill_in('work_submission[title]', with: 'Required Title')
fill_in('work_submission[home_collection_id]', with: archival_collection.id)
Expand Down
10 changes: 5 additions & 5 deletions spec/cho/work/submissions/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
it 'displays only metadata' do
visit(polymorphic_path([:solr_document], id: work.id))
within('div#document') do
expect(page).to have_blacklight_label('title_tesim').with('Object Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('No files')
expect(page).to have_blacklight_label('work_type_ssim').with('Resource Type')
expect(page).to have_blacklight_label('work_type_ssim')
expect(page).to have_blacklight_field('work_type_ssim').with('Document')
expect(page).to have_blacklight_label('home_collection_id_tesim').with('Collection')
expect(page).to have_blacklight_label('home_collection_id_tesim')
expect(page).to have_blacklight_field('home_collection_id_tesim').with('Library Collection')
expect(page).to have_link('Library Collection')
end
Expand All @@ -34,9 +34,9 @@
it 'displays metadata and files' do
visit(polymorphic_path([:solr_document], id: work.id))
within('div#document') do
expect(page).to have_blacklight_label('title_tesim').with('Title')
expect(page).to have_blacklight_label('title_tesim')
expect(page).to have_blacklight_field('title_tesim').with('An editable file')
expect(page).to have_blacklight_label('work_type_ssim').with('Resource Type')
expect(page).to have_blacklight_label('work_type_ssim')
expect(page).to have_blacklight_field('work_type_ssim').with('Document')
end
expect(page).to have_link(
Expand Down

0 comments on commit d02d0d1

Please sign in to comment.