|
518 | 518 | @localOnlyCollection.delete |
519 | 519 | @localObj.delete |
520 | 520 | end |
521 | | - scenario 'rendering the grey generic thumbnail and restricted access info' do |
522 | | - sign_in_developer |
| 521 | + |
| 522 | + scenario 'public user should see the grey generic thumbnail and restricted access info' do |
523 | 523 | visit catalog_index_path({:q => 'xx909090zz'}) |
524 | 524 | expect(page).to have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
525 | 525 | expect(page).to have_content('Restricted View') |
526 | 526 | end |
| 527 | + |
| 528 | + scenario 'curator user should not see the grey generic thumbnail and still see restricted access info' do |
| 529 | + sign_in_developer |
| 530 | + visit catalog_index_path({:q => 'xx909090zz'}) |
| 531 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 532 | + expect(page).to have_content('Restricted View') |
| 533 | + end |
| 534 | + |
| 535 | + scenario 'local user should not see the grey generic thumbnail and restricted access info' do |
| 536 | + sign_in_anonymous '132.239.0.3' |
| 537 | + visit catalog_index_path({:q => 'xx909090zz'}) |
| 538 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 539 | + expect(page).to_not have_content('Restricted View') |
| 540 | + end |
527 | 541 | end |
528 | 542 |
|
529 | 543 | feature 'Visitor wants to view localDisplay License object in UCSD local collection in the search result page' do |
|
544 | 558 | @localOnlyCollection.delete |
545 | 559 | @localObj.delete |
546 | 560 | end |
547 | | - scenario 'rendering the grey generic thumbnail and restricted access info' do |
| 561 | + scenario 'curator user should not see the grey generic thumbnail and still see restricted access info' do |
548 | 562 | sign_in_developer |
| 563 | + visit catalog_index_path({:q => @localObj.pid}) |
| 564 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 565 | + expect(page).to have_content('Restricted View') |
| 566 | + end |
| 567 | + |
| 568 | + scenario 'local user should not see the grey generic thumbnail and restricted access info' do |
| 569 | + sign_in_anonymous '132.239.0.3' |
| 570 | + visit catalog_index_path({:q => @localObj.pid}) |
| 571 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 572 | + expect(page).to_not have_content('Restricted View') |
| 573 | + end |
| 574 | + |
| 575 | + scenario 'public user should see the grey generic thumbnail and restricted access info' do |
549 | 576 | visit catalog_index_path({:q => @localObj.pid}) |
550 | 577 | expect(page).to have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
551 | 578 | expect(page).to have_content('Restricted View') |
|
567 | 594 | @note = DamsNote.create type: "local attribution", value: "Digital Library Development Program, UC San Diego, La Jolla, 92093-0175" |
568 | 595 | @localDisplay = DamsOtherRight.create permissionType: "localDisplay" |
569 | 596 | @publicCollection = DamsProvenanceCollection.create titleValue: "Test Public Collection", visibility: "public" |
570 | | - @localObj = DamsObject.create pid: 'xx909090zz', titleValue: 'Test Object with localDisplay', provenanceCollectionURI: @publicCollection.pid, otherRightsURI: @localDisplay.pid, note_attributes: [{ id: RDF::URI.new("#{ns}#{@note.pid}") }], copyright_attributes: [{status: 'Public domain'}] |
| 597 | + @localObj = DamsObject.create pid: 'xx909090zz', titleValue: 'Test Object with localDisplay', provenanceCollectionURI: @publicCollection.pid, otherRightsURI: @localDisplay.pid, note_attributes: [{ id: RDF::URI.new("#{ns}#{@note.pid}") }], copyright_attributes: [{status: 'Under Copyright'}] |
571 | 598 | solr_index @note.pid |
572 | 599 | solr_index @localDisplay.pid |
573 | 600 | solr_index @publicCollection.pid |
|
586 | 613 | expect(page).to have_content('Restricted View') |
587 | 614 | end |
588 | 615 |
|
589 | | - scenario 'local user should see the grey generic thumbnail and restricted access info' do |
| 616 | + scenario 'local user should not see the grey generic thumbnail and still see restricted access info' do |
590 | 617 | sign_in_anonymous '132.239.0.3' |
591 | 618 | visit catalog_index_path({:q => 'xx909090zz'}) |
592 | | - expect(page).to have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
593 | | - expect(page).to have_content('Restricted View') |
| 619 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 620 | + expect(page).to_not have_content('Restricted View') |
594 | 621 | end |
595 | 622 |
|
596 | | - scenario 'curator user should see the grey generic thumbnail and restricted access info' do |
| 623 | + scenario 'curator user should not see the grey generic thumbnail and still see restricted access info' do |
597 | 624 | sign_in_developer |
598 | 625 | visit catalog_index_path({:q => 'xx909090zz'}) |
| 626 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 627 | + expect(page).to have_content('Restricted View') |
| 628 | + end |
| 629 | +end |
| 630 | + |
| 631 | +feature 'Visitor wants to view metdatadataDisplay object for public collection in the search result page' do |
| 632 | + before(:all) do |
| 633 | + ns = Rails.configuration.id_namespace |
| 634 | + @note = DamsNote.create type: "local attribution", value: "Digital Library Development Program, UC San Diego, La Jolla, 92093-0175" |
| 635 | + @metadataDisplay = DamsOtherRight.create permissionType: "metadataDisplay" |
| 636 | + @publicCollection = DamsProvenanceCollection.create titleValue: "Test Public Collection", visibility: "public" |
| 637 | + @obj = DamsObject.create pid: 'xx909090yy', titleValue: 'Test Object with localDisplay', note_attributes: [{ id: RDF::URI.new("#{ns}#{@note.pid}") }], copyright_attributes: [{status: 'Under Copyright'}] |
| 638 | + @obj.otherRightsURI = @metadataDisplay.pid |
| 639 | + @obj.provenanceCollectionURI = @publicCollection.pid |
| 640 | + @obj.save |
| 641 | + solr_index @note.pid |
| 642 | + solr_index @metadataDisplay.pid |
| 643 | + solr_index @publicCollection.pid |
| 644 | + solr_index @obj.pid |
| 645 | + end |
| 646 | + after(:all) do |
| 647 | + @note.delete |
| 648 | + @metadataDisplay.delete |
| 649 | + @publicCollection.delete |
| 650 | + @obj.delete |
| 651 | + end |
| 652 | + |
| 653 | + scenario 'public user should see the grey generic thumbnail and restricted access info' do |
| 654 | + visit catalog_index_path({:q => 'xx909090yy'}) |
| 655 | + expect(page).to have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 656 | + expect(page).to have_content('Restricted View') |
| 657 | + end |
| 658 | + |
| 659 | + scenario 'local user should see the grey generic thumbnail and still see restricted access info' do |
| 660 | + sign_in_anonymous '132.239.0.3' |
| 661 | + visit catalog_index_path({:q => 'xx909090yy'}) |
599 | 662 | expect(page).to have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
600 | 663 | expect(page).to have_content('Restricted View') |
601 | 664 | end |
| 665 | + |
| 666 | + scenario 'curator user should not see the grey generic thumbnail and still see restricted access info' do |
| 667 | + sign_in_developer |
| 668 | + visit catalog_index_path({:q => 'xx909090yy'}) |
| 669 | + expect(page).to_not have_css('img.dams-search-thumbnail[src="https://library.ucsd.edu/assets/dams/site/thumb-restricted.png"]') |
| 670 | + expect(page).to have_content('Restricted View') |
| 671 | + end |
602 | 672 | end |
0 commit comments