source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/import_url_job_spec.rb
Ruby
apache-2.0
197
main
6,864
# frozen_string_literal: true RSpec.describe ImportUrlJob do let(:user) { create(:user) } let(:file_path) { fixture_path + '/world.png' } let(:file_hash) { '/673467823498723948237462429793840923582' } let(:label) { file_path } let(:operation) { create(:operation) } let(:mock_retriever) { double } let(:in...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/content_new_version_event_job_spec.rb
Ruby
apache-2.0
197
main
916
# frozen_string_literal: true RSpec.describe ContentNewVersionEventJob do let(:user) { create(:user) } let(:file_set) { valkyrie_create(:hyrax_file_set, title: ['Hamlet'], depositor: user.user_key) } let(:mock_time) { Time.zone.at(1) } let(:event) { { action: "User <a href=\"/users/#{user.to_param}\">#{user.use...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/migrate_resources_job_spec.rb
Ruby
apache-2.0
197
main
1,093
# frozen_string_literal: true require 'freyja/persister' RSpec.describe MigrateResourcesJob, index_adapter: :solr_index, valkyrie_adapter: :freyja_adapter do let(:af_file_set) { create(:file_set, title: ['TestFS']) } let!(:af_admin_set) do as = AdminSet.new(title: ['AF Admin Set']) as.save AdminSet.fi...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/file_set_attached_event_job_spec.rb
Ruby
apache-2.0
197
main
2,259
# frozen_string_literal: true RSpec.describe FileSetAttachedEventJob do let(:user) { FactoryBot.create(:user) } let(:mock_time) { Time.zone.at(1) } let(:event) do { action: "User <a href=\"/users/#{user.to_param}\">#{user.user_key}</a> " \ "has attached <a href=\"/concern/file_sets/#{file...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/lease_expiry_job_spec.rb
Ruby
apache-2.0
197
main
3,521
# frozen_string_literal: true RSpec.describe LeaseExpiryJob, :clean_repo, :frozen_time do subject { described_class } context 'with Valkyrie resources' do let!(:leased_work) { valkyrie_create(:hyrax_work, :under_lease) } let!(:work_with_expired_lease) { valkyrie_create(:hyrax_work, :with_expiring_enforced_...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/attach_files_to_work_job_spec.rb
Ruby
apache-2.0
197
main
8,042
# frozen_string_literal: true RSpec.describe AttachFilesToWorkJob, :active_fedora, perform_enqueued: [AttachFilesToWorkJob] do let(:file1) { File.open(fixture_path + '/world.png') } let(:file2) { File.open(fixture_path + '/image.jp2') } let(:uploaded_file1) { build(:uploaded_file, file: file1) } let(:uploaded_f...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/create_work_job_spec.rb
Ruby
apache-2.0
197
main
3,663
# frozen_string_literal: true RSpec.describe CreateWorkJob do let(:user) { FactoryBot.create(:user) } let(:log) do Hyrax::Operation.create!(user: user, operation_type: "Create Work") end describe "#perform", perform_enqueued: [described_class] do let(:file1) { File.open(fix...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/migrate_files_to_valkyrie_job_spec.rb
Ruby
apache-2.0
197
main
1,637
# frozen_string_literal: true require 'wings' RSpec.describe MigrateFilesToValkyrieJob, index_adapter: :solr_index, valkyrie_adapter: :freyja_adapter, perform_enqueued: [MigrateFilesToValkyrieJob] do let(:user) { create(:user) } let(:content) { File.open(fixture_path + '/' + label) } let(:uploaded_file1) { ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/visibility_copy_job_spec.rb
Ruby
apache-2.0
197
main
3,721
# frozen_string_literal: true RSpec.describe VisibilityCopyJob do context 'with a valkyrie resource' do let(:proxy) { Hyrax::ActiveJobProxy.new(resource: resource) } let(:resource) { valkyrie_create(:hyrax_work, :with_member_file_sets, visibility_setting: 'open') } let(:queries) { Hyrax.custom_querie...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/inherit_permissions_job_spec.rb
Ruby
apache-2.0
197
main
7,830
# frozen_string_literal: true RSpec.describe InheritPermissionsJob do let(:user) { FactoryBot.create(:user) } context "when using a legacy AF resource", :active_fedora do let(:work) { FactoryBot.create(:work_with_one_file, user: user) } before do work.permissions.build(name: name, type: type, access...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/attach_files_to_work_with_ordered_members_job_spec.rb
Ruby
apache-2.0
197
main
1,868
# frozen_string_literal: true # NOTE: This job initiates the Actor Stack with ActiveFedora objects. RSpec.describe AttachFilesToWorkWithOrderedMembersJob, :active_fedora, perform_enqueued: [AttachFilesToWorkWithOrderedMembersJob] do let(:file1) { File.open(fixture_path + '/world.png') } let(:file2) { File.open(fix...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/ingest_local_file_job_spec.rb
Ruby
apache-2.0
197
main
1,362
# frozen_string_literal: true RSpec.describe IngestLocalFileJob, :active_fedora do let(:user) { create(:user) } let(:path) { File.join(fixture_path, 'world.png') } let(:file_set) { FileSet.new } it 'has attached a file' do expect(FileUtils).not_to receive(:rm) expect(Hyrax.config.callback).to receive(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/content_delete_event_job_spec.rb
Ruby
apache-2.0
197
main
1,187
# frozen_string_literal: true RSpec.describe ContentDeleteEventJob do let(:user) { create(:user) } let(:mock_time) { Time.zone.at(1) } let(:event) do { action: "User <a href=\"/users/#{user.to_param}\">#{user.user_key}</a> has deleted object '#{curation_concern.id}'", timestamp: '1' } end ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/fixity_check_job_spec.rb
Ruby
apache-2.0
197
main
1,713
# frozen_string_literal: true # NOTE: A Valkyrie-compliant Fixity Check service needs to be created. RSpec.describe FixityCheckJob, :active_fedora do let(:user) { create(:user) } let(:file_set) do create(:file_set, user: user).tap do |file| Hydra::Works::AddFileToFileSet.call(file, File.open(fixture_pat...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/valkyrie_ingest_job_spec.rb
Ruby
apache-2.0
197
main
3,583
# frozen_string_literal: true require 'hyrax/specs/spy_listener' RSpec.describe ValkyrieIngestJob do let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set) } let(:upload) { FactoryBot.create(:uploaded_file, file_set_uri: file_set.id, file: File.open('spec/fixtures/image.png')) } let(:listener) { Hyrax::S...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/import_export_job_spec.rb
Ruby
apache-2.0
197
main
894
# frozen_string_literal: true require 'spec_helper' # NOTE: This job communicates exclusively with Fedora. RSpec.describe ImportExportJob, :active_fedora do let(:work) { create(:work) } let(:job) { described_class.new } describe "when exporting" do let(:command) do "java -jar tmp/fcrepo-import-...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/valkyrie_characterization_job_spec.rb
Ruby
apache-2.0
197
main
739
# frozen_string_literal: true require 'spec_helper' RSpec.describe ValkyrieCharacterizationJob, valkyrie_adapter: :test_adapter do context 'with a file' do let(:file_metadata) { FactoryBot.valkyrie_create(:hyrax_file_metadata) } let(:file) { double } before do allow(file_metadata).to receive(:file...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/user_edit_profile_event_job_spec.rb
Ruby
apache-2.0
197
main
574
# frozen_string_literal: true RSpec.describe UserEditProfileEventJob do let(:user) { create(:user) } let(:mock_time) { Time.zone.at(1) } let(:event) { { action: "User <a href=\"/users/#{user.to_param}\">#{user.user_key}</a> has edited their profile", timestamp: '1' } } before do allow(Time).to receive(:now...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/content_update_event_job_spec.rb
Ruby
apache-2.0
197
main
962
# frozen_string_literal: true RSpec.describe ContentUpdateEventJob do let(:user) { create(:user) } let(:mock_time) { Time.zone.at(1) } let(:curation_concern) { valkyrie_create(:hyrax_file_set, title: ['Hamlet'], depositor: user.user_key) } let(:event) do { action: "User <a href=\"/users/#{user.to_para...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/concerns/hyrax/queued_job_behavior_spec.rb
Ruby
apache-2.0
197
main
2,066
# frozen_string_literal: true require 'spec_helper' RSpec.describe Hyrax::QueuedJobBehavior do let(:including_class) do Class.new(ApplicationJob) do include Hyrax::QueuedJobBehavior def perform(*_args) redis_queue.index_queue(size: 200) end end end let(:instance) { including_c...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/revoke_edit_from_members_job_spec.rb
Ruby
apache-2.0
197
main
1,260
# frozen_string_literal: true RSpec.describe Hyrax::RevokeEditFromMembersJob, :active_fedora do let(:depositor) { create(:user) } context "when using active fedora" do let(:work) { create(:work) } let(:file_set_ids) { ['xyz123abc', 'abc789zyx'] } before do allow_any_instance_of(described_class)....
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/grant_read_job_spec.rb
Ruby
apache-2.0
197
main
848
# frozen_string_literal: true RSpec.describe Hyrax::GrantReadJob do let(:depositor) { create(:user) } context "when use_valkyrie is false", :active_fedora do let(:file_set) { create(:file_set) } it 'grants a user read access to a FileSet' do described_class.perform_now(file_set.id, depositor.user_ke...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/queued_delete_job_spec.rb
Ruby
apache-2.0
197
main
1,136
# frozen_string_literal: true require 'spec_helper' RSpec.describe Hyrax::QueuedDeleteJob do let(:job) { described_class.new } let(:redis_queue) { instance_double(Valkyrie::Indexing::RedisQueue::IndexingAdapter) } before do allow(Valkyrie::IndexingAdapter).to receive(:find).with(:redis_queue).and_return(red...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/grant_read_to_members_job_spec.rb
Ruby
apache-2.0
197
main
1,230
# frozen_string_literal: true RSpec.describe Hyrax::GrantReadToMembersJob, perform_enqueued: [Hyrax::GrantReadToMembersJob] do let(:depositor) { FactoryBot.create(:user) } context "when using active fedora", :active_fedora do let(:work) { FactoryBot.create(:work_with_files) } it 'loops over FileSet IDs, s...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/queued_indexing_job_spec.rb
Ruby
apache-2.0
197
main
1,134
# frozen_string_literal: true require 'spec_helper' RSpec.describe Hyrax::QueuedIndexingJob do let(:job) { described_class.new } let(:redis_queue) { instance_double(Valkyrie::Indexing::RedisQueue::IndexingAdapter) } before do allow(Valkyrie::IndexingAdapter).to receive(:find).with(:redis_queue).and_return(r...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/grant_edit_job_spec.rb
Ruby
apache-2.0
197
main
848
# frozen_string_literal: true RSpec.describe Hyrax::GrantEditJob do let(:depositor) { create(:user) } context "when use_valkyrie is false", :active_fedora do let(:file_set) { create(:file_set) } it 'grants a user edit access to a FileSet' do described_class.perform_now(file_set.id, depositor.user_ke...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/revoke_edit_job_spec.rb
Ruby
apache-2.0
197
main
863
# frozen_string_literal: true RSpec.describe Hyrax::RevokeEditJob do let(:depositor) { create(:user) } context "when use_valkyrie is false", :active_fedora do let(:file_set) { create(:file_set) } it "revokes a user's edit access to a FileSet" do described_class.perform_now(file_set.id, depositor.use...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/propagate_change_depositor_job_spec.rb
Ruby
apache-2.0
197
main
2,959
# frozen_string_literal: true RSpec.describe Hyrax::PropagateChangeDepositorJob do let(:depositor) { create(:user) } let!(:receiver) { create(:user) } context "for AF objects", :active_fedora do let(:file_set) { create(:file_set) } let!(:file) do create(:file_set, user: depositor) end let!(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/jobs/hyrax/grant_edit_to_members_job_spec.rb
Ruby
apache-2.0
197
main
1,255
# frozen_string_literal: true RSpec.describe Hyrax::GrantEditToMembersJob do let(:depositor) { create(:user) } context "when using active fedora", :active_fedora do let(:work) { create(:work) } let(:file_set_ids) { ['xyz123abc', 'abc789zyx'] } before do allow_any_instance_of(described_class).to ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/date_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
1,260
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::DateAttributeRenderer do subject { Nokogiri::HTML(renderer.render) } let(:expected) { Nokogiri::HTML(tr_content) } describe "#attribute_to_html" do context 'with embargo release date' do let(:field) { :embargo_release_date } let(:ren...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/rights_statement_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
1,014
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::RightsStatementAttributeRenderer do let(:field) { :rights_statement } let(:renderer) { described_class.new(field, ['http://rightsstatements.org/vocab/InC/1.0/']) } describe "#attribute_to_html" do subject { Nokogiri::HTML(renderer.render) } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/license_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
1,012
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::LicenseAttributeRenderer do let(:field) { :license } let(:renderer) { described_class.new(field, ['http://creativecommons.org/licenses/by/3.0/us/', 'http://creativecommons.org/licenses/by-nd/3.0/us/']) } describe "#attribute_to_html" do subject {...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
4,419
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::AttributeRenderer do let(:field) { :name } let(:renderer) { described_class.new(field, ['Bob', 'Jessica']) } let(:yml_path) { File.join(fixture_path, 'config', 'schema_org.{yml}') } before do Hyrax::Microdata.load_paths += Dir[yml_path] Hyr...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/linked_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
820
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::LinkedAttributeRenderer do let(:field) { :name } let(:renderer) { described_class.new(field, ['Bob', 'Jessica']) } describe "#attribute_to_html" do subject { Nokogiri::HTML(renderer.render) } let(:expected) { Nokogiri::HTML(tr_content) } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/faceted_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
1,249
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::FacetedAttributeRenderer do let(:field) { :name } let(:renderer) { described_class.new(field, ['Bob', 'Jessica']) } describe "#attribute_to_html" do subject { Nokogiri::HTML(renderer.render) } let(:expected) { Nokogiri::HTML(tr_content) } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/renderers/hyrax/renderers/external_link_attribute_renderer_spec.rb
Ruby
apache-2.0
197
main
710
# frozen_string_literal: true RSpec.describe Hyrax::Renderers::ExternalLinkAttributeRenderer do let(:field) { :name } let(:renderer) { described_class.new(field, ['http://example.com']) } describe "#attribute_to_html" do subject { Nokogiri::HTML(renderer.render) } let(:expected) { Nokogiri::HTML(tr_cont...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_admin_set_spec.rb
Ruby
apache-2.0
197
main
10,638
# frozen_string_literal: true RSpec.describe 'Creating a new Admin Set', :js, :workflow, :clean_repo do include Selectors::Dashboard let(:admin) { create(:admin, email: 'admin@example.com') } let(:manager) { create(:user, email: 'manager@example.com') } let(:creator) { create(:user, email: 'creator@example.c...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_work_admin_spec.rb
Ruby
apache-2.0
197
main
1,131
# frozen_string_literal: true RSpec.describe 'Creating a new Work as admin', :js, :workflow, :clean_repo, perform_enqueued: [AttachFilesToWorkJob, IngestJob] do let(:user) { create(:admin) } before do Hyrax::AdminSetCreateService.find_or_create_default_admin_set valkyrie_create(:hyrax_admin_set, :with_perm...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/collection_multi_membership_spec.rb
Ruby
apache-2.0
197
main
10,415
# frozen_string_literal: true RSpec.describe 'Adding a work to multiple collections', :clean_repo, type: :feature, js: true do include Selectors::Dashboard let(:admin_user) { create(:admin, email: 'admin@example.com') } let(:single_membership_type_1) { create(:collection_type, :not_allow_multiple_membership, titl...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/bulkrax_spec.rb
Ruby
apache-2.0
197
main
1,786
# frozen_string_literal: true RSpec.describe 'Bulkrax', :js, :workflow, :clean_repo, skip: !Hyrax.config.disable_wings, perform_enqueued: true do let(:user) { create(:admin) } before do Hyrax::EnsureWellFormedAdminSetService.call sign_in user end it 'imports CSV' do v...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/collection_type_spec.rb
Ruby
apache-2.0
197
main
17,693
# frozen_string_literal: true RSpec.describe 'collection_type', type: :feature do let(:admin_user) { FactoryBot.create(:admin) } let(:exhibit_collection_type) do FactoryBot.create(:collection_type, title: 'Exhibit', description: 'Description for exhibit collection ty...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/work_show_spec.rb
Ruby
apache-2.0
197
main
9,821
# frozen_string_literal: true RSpec.describe "work show view" do include Selectors::Dashboard let(:work_path) { "/concern/generic_works/#{work.id}" } # this context was added to section off a new test supporting # development in the valkyrie context. It doesn't reflect AF-only # functionality; these tests p...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/edit_file_spec.rb
Ruby
apache-2.0
197
main
2,157
# frozen_string_literal: true RSpec.describe "Editing a file:", type: :feature do let(:user) { create(:user) } let(:permission_template) { create(:permission_template, source_id: admin_set.id) } let!(:workflow) { create(:workflow, allows_access_grant: true, active: true, permission_template_id: permission_templat...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/batch_edit_spec.rb
Ruby
apache-2.0
197
main
6,255
# frozen_string_literal: true RSpec.describe 'batch', type: :feature, clean_repo: true, js: true do let(:wings_disabled) { Hyrax.config.disable_wings } let(:query_service) { Hyrax.query_service } let(:expected_element_text) { wings_disabled ? 'monograph' : 'generic_work' } let(:current_user) { create(:user) }...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/delete_work_spec.rb
Ruby
apache-2.0
197
main
735
# frozen_string_literal: true RSpec.describe 'Deleting a work', type: :feature do let(:user) { FactoryBot.create(:user) } let(:work) { FactoryBot.valkyrie_create(:comet_in_moominland, depositor: user.user_key, edit_users: [user], members: [file_set]) } let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/batch_create_spec.rb
Ruby
apache-2.0
197
main
2,983
# frozen_string_literal: true RSpec.describe 'Batch creation of works', type: :feature do let(:user) { create(:user) } before do Hyrax::EnsureWellFormedAdminSetService.call sign_in user allow(Flipflop).to receive(:batch_upload?).and_return true allow(Hyrax.config).to receive(:use_valkyrie?).and_re...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/delete_resource_spec.rb
Ruby
apache-2.0
197
main
1,504
# frozen_string_literal: true require 'spec_helper' require 'hyrax/specs/spy_listener' RSpec.describe 'Deleting a valkyrie work', type: :feature, valkyrie_adapter: :test_adapter, index_adapter: :solr_index do let(:work) do FactoryBot.valkyrie_create(:monograph, :as_member_of_multi...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/embargo_spec.rb
Ruby
apache-2.0
197
main
6,527
# frozen_string_literal: true RSpec.describe 'embargo' do let(:user) { create(:user) } before do sign_in user Wings::ModelRegistry.register(GenericWorkResource, GenericWork) if defined?(Wings::ModelRegistry) end after do Wings::ModelRegistry.unregister(GenericWorkResource) if defined?(Wings::Model...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/proxy_spec.rb
Ruby
apache-2.0
197
main
2,099
# frozen_string_literal: true RSpec.describe 'proxy', type: :feature do let(:user) { create(:user) } let(:second_user) { create(:user) } describe 'add proxy in profile', :js do it "creates a proxy, then deletes a proxy, and verifies deletion" do sign_in user # Prior to capturing the after sign in...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/default_workflow_spec.rb
Ruby
apache-2.0
197
main
1,735
# frozen_string_literal: true RSpec.describe 'The default Hyrax workflow', type: :feature, valkyrie_adapter: :test_adapter do let(:depositor) { FactoryBot.create(:user) } let(:work) do FactoryBot.valkyrie_create(:hyrax_work, :with_default_admin_set, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/read_only_mode_spec.rb
Ruby
apache-2.0
197
main
3,020
# frozen_string_literal: true require 'rails_helper' include Warden::Test::Helpers RSpec.feature 'Read Only Mode' do let(:admin) { create :user } context 'a logged in user' do let(:user) { create(:user) } let(:admin_user) { FactoryBot.create(:admin) } let(:admin_set) { valkyrie_create(:hyrax_admin_set...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/edit_pages_admin.spec.rb
Ruby
apache-2.0
197
main
2,208
# frozen_string_literal: true RSpec.describe 'Editing pages as admin', :js do let(:user) { create(:admin) } context 'when user wants to change tabs' do let!(:confirm_modal_text) { 'Are you sure you want to leave this tab? Any unsaved data will be lost.' } before do sign_in user visit '/dashboa...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/iiif_manifest_spec.rb
Ruby
apache-2.0
197
main
1,796
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'building a IIIF Manifest', :aggregate_failures do let(:work) { valkyrie_create(:comet_in_moominland, :public, description: ['a novel about moomins'], members: children) } let(:children) { valkyrie_create_list(:monograph, 1, members: file_sets) + ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/monograph_deposit_spec.rb
Ruby
apache-2.0
197
main
2,350
# frozen_string_literal: true RSpec.describe 'Creating a new Monograph (Valkyrie work)', :js, :workflow, :clean_repo do let(:user) { FactoryBot.create(:user) } before do Hyrax::EnsureWellFormedAdminSetService.call FactoryBot .create(:permission_template_access, :deposit, p...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/users_spec.rb
Ruby
apache-2.0
197
main
1,698
# frozen_string_literal: true RSpec.describe "User Profile", type: :feature do before do sign_in user end let(:user) { create(:user) } let(:profile_path) { Hyrax::Engine.routes.url_helpers.user_path(user, locale: 'en') } context 'when visiting user profile with highlighted works' do let(:work) { valk...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/contact_form_spec.rb
Ruby
apache-2.0
197
main
621
# frozen_string_literal: true RSpec.describe "Sending an email via the contact form", type: :feature do before { sign_in(:user) } it "sends mail" do visit '/' click_link "Contact" expect(page).to have_content "Contact Form" fill_in "Your Name", with: "Test McPherson" fill_in "Your Email", with:...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/ownership_transfer_spec.rb
Ruby
apache-2.0
197
main
3,709
# frozen_string_literal: true RSpec.describe 'Transferring work ownership:', type: :feature do include Selectors::Dashboard include Selectors::NewTransfers include Selectors::Transfers let(:original_owner) { create(:user) } let(:new_owner) { create(:user) } let!(:work) do if Hyrax.config.use_valkyrie? ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/browse_catalog_spec.rb
Ruby
apache-2.0
197
main
1,545
# frozen_string_literal: true RSpec.describe "Browse catalog:", type: :feature, clean_repo: true do let!(:jills_work) do valkyrie_create(:monograph, title: ["Jill's Research"], keyword: (1..25).to_a.map { |i| "keyword#{format('%02d', i)}" }, read_groups: ['pub...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/collection_spec.rb
Ruby
apache-2.0
197
main
5,780
# frozen_string_literal: true RSpec.describe 'collection', type: :feature do let(:user) { FactoryBot.create(:user) } before { sign_in(user) } shared_context 'with many indexed members' do let(:collection) { FactoryBot.valkyrie_create(:hyrax_collection, user: user, title: ['collection title'], description: [...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_child_work_spec.rb
Ruby
apache-2.0
197
main
3,011
# frozen_string_literal: true require 'redlock' RSpec.describe 'Creating a new child Work', :workflow do let(:user) { create(:user) } let!(:sipity_entity) { create(:sipity_entity, proxy_for: parent) } let(:redlock_client_stub) do # stub out redis connection client = double('redlock client') allow(client)...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/lease_spec.rb
Ruby
apache-2.0
197
main
2,085
# frozen_string_literal: true RSpec.describe 'leases' do let(:user) { create(:user) } before do sign_in user Wings::ModelRegistry.register(GenericWorkResource, GenericWork) if defined?(Wings::ModelRegistry) end after do Wings::ModelRegistry.unregister(GenericWorkResource) if defined?(Wings::ModelR...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/workflow_roles_spec.rb
Ruby
apache-2.0
197
main
1,385
# frozen_string_literal: true RSpec.describe "Manage workflow roles", type: :feature do let(:user) { create(:admin) } let(:one_step_workflow) do { workflows: [ { name: "one_step", label: "One-step mediated deposit workflow", description: "A single-step workflow for me...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/edit_work_resource_spec.rb
Ruby
apache-2.0
197
main
2,789
# frozen_string_literal: true RSpec.describe 'Editing an existing Hyrax::Work Resource', :js, :workflow, :feature, :clean_repo do let(:user) { FactoryBot.create(:user) } let(:work) do FactoryBot.valkyrie_create(:comet_in_moominland, :with_admin_set, admin_set: old_admin_set, edit_users: [user]) end let(:d...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/search_spec.rb
Ruby
apache-2.0
197
main
3,587
# frozen_string_literal: true RSpec.shared_examples "search functionality" do |_adapter| let(:user) { create :user } let(:subject_value) { 'mustache' } let!(:work) do if Hyrax.config.use_valkyrie? FactoryBot.valkyrie_create(:monograph, :public, title: ["Toothbrush"], keyword: [subject_value, 'taco']) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_work_spec.rb
Ruby
apache-2.0
197
main
7,487
# frozen_string_literal: true RSpec.describe 'Creating a new Work', :js, :workflow, :clean_repo do let(:user) { create(:user) } let!(:ability) { ::Ability.new(user) } let(:file1) { File.open(fixture_path + '/world.png') } let(:file2) { File.open(fixture_path + '/image.jp2') } let!(:uploaded_file1) { Hyrax::U...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/deposit_agreements_spec.rb
Ruby
apache-2.0
197
main
1,759
# frozen_string_literal: true RSpec.describe 'Deposit Agreement options', :js, :workflow, :clean_repo do let(:user) { create(:user) } let!(:ability) { ::Ability.new(user) } let(:permission_template) { create(:permission_template, with_admin_set: true, with_active_workflow: true) } before do # Grant the use...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/file_manager_spec.rb
Ruby
apache-2.0
197
main
2,128
# frozen_string_literal: true RSpec.describe "file manager" do let(:user) { FactoryBot.create(:admin) } let!(:work) do FactoryBot.valkyrie_create(:monograph, :with_member_file_sets, :public, title: ["Toothbrush"]) end let(:file_set) do Hyrax.query_service.find_members(resource: work).first ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/iiif_av_manifest_spec.rb
Ruby
apache-2.0
197
main
5,500
# frozen_string_literal: true RSpec.describe 'building a IIIF AV Manifest', :aggregate_failures do let(:work) { valkyrie_create(:monograph, :public, title: ['AV Test Work'], members: file_sets) } let(:user) { create(:admin) } before do allow(Flipflop).to receive(:iiif_av?).and_return(true) end context ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/iiif_viewer_generator_spec.rb
Ruby
apache-2.0
197
main
5,232
# frozen_string_literal: true require 'rails/generators' RSpec.describe "Installing or removing a IIIF audio/video viewer" do let(:viewer) { ["clover"] } let(:dest_root) { Hyrax::Engine.root.join("tmp") } let(:config) { dest_root.join('config', 'initializers', 'hyrax.rb').to_s } before do # Reset the file...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/notifications_spec.rb
Ruby
apache-2.0
197
main
1,026
# frozen_string_literal: true RSpec.describe "Notifications page", type: :feature do before do sign_in create(:user_with_mail) visit "/notifications" end it "lists notifications with date, subject and message" do expect(page).to have_content "Notifications" expect(page).to have_selector "table.da...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_work_resource_spec.rb
Ruby
apache-2.0
197
main
2,597
# frozen_string_literal: true RSpec.describe 'Creating a new Hyrax::Work Resource', :js, :workflow, :feature do let(:user) { create(:user) } let(:file1) { File.open(fixture_path + '/world.png') } let(:file2) { File.open(fixture_path + '/image.jp2') } let!(:uploaded_file1) { Hyrax::UploadedFile.create(file: file...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/actor_stack_spec.rb
Ruby
apache-2.0
197
main
6,039
# frozen_string_literal: true require 'rails_helper' # Integration tests for the full midddleware stack RSpec.describe Hyrax::DefaultMiddlewareStack, :active_fedora, :clean_repo do subject(:actor) { stack.build(Hyrax::Actors::Terminator.new) } let(:ability) { ::Ability.new(user) } let(:attributes) { {} } l...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/catalog_search_spec.rb
Ruby
apache-2.0
197
main
2,659
# frozen_string_literal: true RSpec.describe 'catalog searching', type: :feature do before do allow(User).to receive(:find_by_user_key).and_return(stub_model(User, twitter_handle: 'bob')) sign_in :user visit '/' end context 'with works and collections' do let!(:jills_work) do FactoryBot.val...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/admin_spec.rb
Ruby
apache-2.0
197
main
1,423
# frozen_string_literal: true RSpec.describe "The admin dashboard", :clean_repo do let(:user) { create :admin } let(:admin_set_1) do valkyrie_create(:hyrax_admin_set, title: ["First Admin Set"], description: ["A description"], edit_user...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/edit_content_block_admin_spec.rb
Ruby
apache-2.0
197
main
2,419
# frozen_string_literal: true RSpec.describe 'Editing content blocks as admin', :js do let(:user) { create(:admin) } context 'when user wants to change tabs' do let!(:confirm_modal_text) { 'Are you sure you want to leave this tab? Any unsaved data will be lost.' } before do allow(Hyrax::Statistic).t...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/workflow_state_changes_spec.rb
Ruby
apache-2.0
197
main
3,076
# frozen_string_literal: true RSpec.describe "Workflow state changes", type: :feature do let(:wings_disabled) { Hyrax.config.disable_wings } let(:workflow_name) { 'with_comment' } let(:approving_user) { create(:admin) } let(:depositing_user) { create(:admin) } let(:admin_set) do if wings_disabled va...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/homepage_spec.rb
Ruby
apache-2.0
197
main
2,202
# frozen_string_literal: true RSpec.describe "The homepage", :clean_repo do let(:work1) { valkyrie_create(:monograph, :public, title: ["Work 1"], date_uploaded: (DateTime.current - 1.day)) } let(:work2) { valkyrie_create(:monograph, :public, title: ["Work 2"], date_uploaded: (DateTime.current - 1.year)) } before...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/work_generator_spec.rb
Ruby
apache-2.0
197
main
1,407
# frozen_string_literal: true require 'rails/generators' require 'redlock' RSpec.describe 'Creating a new Work' do before do Rails::Generators.invoke('hyrax:work', ['Catapult', '--quiet'], destination_root: Rails.root) load Rails.root.join('app', 'indexers', 'catapult_indexer.rb') load Rails.root.join('a...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/edit_work_spec.rb
Ruby
apache-2.0
197
main
3,556
# frozen_string_literal: true RSpec.describe 'Editing a work', :clean_repo, type: :feature do let(:user) { create(:user, groups: 'librarians') } let(:user_admin) { create(:user, groups: 'admin') } let(:work) { valkyrie_create(:monograph, :with_one_file_set, depositor: user.user_key, admin_set_id: another_admin_se...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/create_collection_spec.rb
Ruby
apache-2.0
197
main
6,870
# frozen_string_literal: true RSpec.describe 'Creating a new Admin Set', :js, :workflow, :clean_repo do let(:admin) { create(:admin, email: 'admin@example.com') } let(:manager) { create(:user, email: 'manager@example.com') } let(:creator) { create(:user, email: 'creator@example.com') } let(:user) { create(:user...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/browse_dashboard_works_spec.rb
Ruby
apache-2.0
197
main
2,812
# frozen_string_literal: true RSpec.describe "Browse Dashboard", :clean_repo, type: :feature do let(:user) { FactoryBot.create(:user) } let!(:dissertation) do FactoryBot.valkyrie_create(:monograph, :public, depositor: user.user_key, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/dashboard/my_works_spec.rb
Ruby
apache-2.0
197
main
1,907
# frozen_string_literal: true # https://github.com/samvera/hyrax/issues/5969 RSpec.describe "As an regular user I should be able to filter works and add them to a preselected collection", :clean_repo do let(:user) { create(:user) } let!(:work1) { valkyrie_create(:monograph, title: ['Testing Work'], admin_set_id: ad...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/dashboard/all_works.rb
Ruby
apache-2.0
197
main
1,009
# frozen_string_literal: true RSpec.describe "As an admin user I should be able to see all works", :clean_repo do let!(:work1) { create(:work, title: ['Testing #1'], admin_set: adminset, member_of_collections: [collection]) } let!(:work2) { create(:work, title: ['Testing #2'], admin_set: adminset, member_of_collect...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/dashboard/display_admin_dashboard_spec.rb
Ruby
apache-2.0
197
main
815
# frozen_string_literal: true RSpec.describe "The dashboard as viewed by a admin user", type: :feature do let(:admin) { create(:admin) } before do sign_in admin end context "upon sign-in" do it "shows the admin user's information" do expect(page).to have_content "Dashboard" expect(page).to...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/dashboard/collection_spec.rb
Ruby
apache-2.0
197
main
49,519
# frozen_string_literal: true RSpec.describe 'collection', type: :feature, clean_repo: true do include Selectors::Dashboard let(:user) { create(:user) } let(:admin_user) { create(:admin) } let(:collection_type) { create(:collection_type, creator_user: user) } let(:user_collection_type) { create(:user_collec...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/features/dashboard/display_dashboard_spec.rb
Ruby
apache-2.0
197
main
587
# frozen_string_literal: true RSpec.describe "The dashboard as viewed by a regular user", type: :feature do before do sign_in end context "upon sign-in" do it "shows the user's information" do expect(page).to have_content "Dashboard" expect(page).to have_content "User Activity" expect(p...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/generic_work_spec.rb
Ruby
apache-2.0
197
main
3,888
# frozen_string_literal: true RSpec.describe GenericWork, :active_fedora do it 'has a title' do subject.title = ['foo'] expect(subject.title).to eq ['foo'] end describe '.model_name' do subject { described_class.model_name.singular_route_key } it { is_expected.to eq 'hyrax_generic_work' } end ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/job_io_wrapper_spec.rb
Ruby
apache-2.0
197
main
8,706
# frozen_string_literal: true RSpec.describe JobIoWrapper, :active_fedora, type: :model do let(:user) { build(:user) } let(:path) { fixture_path + '/world.png' } let(:file_set_id) { 'bn999672v' } let(:file_set) { instance_double(FileSet, id: file_set_id, uri: 'http://127.0.0.1/rest/fake/bn/99/96/72/bn999672v') ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/featured_work_spec.rb
Ruby
apache-2.0
197
main
1,509
# frozen_string_literal: true RSpec.describe FeaturedWork, type: :model do let(:feature) { described_class.create(work_id: "99") } describe '.feature_limit' do subject { described_class.feature_limit } it { is_expected.to be_a(Integer) } end it "has a file" do expect(feature.work_id).to eq "99" ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/single_use_link_spec.rb
Ruby
apache-2.0
197
main
1,181
# frozen_string_literal: true RSpec.describe SingleUseLink do subject(:link) { described_class.new item_id: '99999', path: path } let(:file) { FileSet.new(id: 'abc123') } let(:hash) { "sha2hash#{DateTime.current.to_f}" } let(:path) { '/foo/file/99999' } before do allow(described_class).to receive(:genera...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/trophy_spec.rb
Ruby
apache-2.0
197
main
601
# frozen_string_literal: true RSpec.describe Trophy, type: :model do let(:trophy) { described_class.create(user_id: 99, work_id: "99") } it "has a user" do expect(trophy).to respond_to(:user_id) expect(trophy.user_id).to eq(99) end it "has a work" do expect(trophy).to respond_to(:work_id) expe...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/collection_spec.rb
Ruby
apache-2.0
197
main
11,586
# frozen_string_literal: true RSpec.describe ::Collection, :active_fedora, type: :model do let(:collection) { build(:public_collection_lw) } it "has open visibility" do expect(collection.read_groups).to eq ['public'] end describe "#validates_with" do before { collection.title = nil } it "ensures t...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/file_view_stat_spec.rb
Ruby
apache-2.0
197
main
3,202
# frozen_string_literal: true RSpec.describe FileViewStat, type: :model do let(:file_id) { file.id } let(:user_id) { 123 } let(:date) { Time.current } let(:file_stat) { described_class.create(views: "25", date: date, file_id: file_id, user_id: user_id) } let(:file) { mock_model('MockFileSet', id: 99) } it ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/checksum_audit_log_spec.rb
Ruby
apache-2.0
197
main
8,771
# frozen_string_literal: true RSpec.describe ChecksumAuditLog do let(:wings_disabled?) { Hyrax.config.disable_wings } let(:storage_adapter) { Hyrax.storage_adapter } let(:file) { create(:uploaded_file, file: File.open('spec/fixtures/world.png')) } let(:file_metadata) { valkyrie_create(:file_metadata, :original_...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/admin_set_spec.rb
Ruby
apache-2.0
197
main
6,698
# frozen_string_literal: true RSpec.describe AdminSet, :active_fedora, type: :model do let(:gf1) { create(:generic_work, user: user) } let(:gf2) { create(:generic_work, user: user) } let(:gf3) { create(:generic_work, user: user) } let(:user) { create(:user) } subject { described_class.new(title: ['Some titl...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/content_block_spec.rb
Ruby
apache-2.0
197
main
5,643
# frozen_string_literal: true RSpec.describe ContentBlock, type: :model do describe '.for' do context 'with a nil' do it 'raises an ArgumentError' do expect { described_class.for(nil) }.to raise_error(ArgumentError) end end context 'with a non-registered value' do it 'raises an A...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/file_set_spec.rb
Ruby
apache-2.0
197
main
19,983
# frozen_string_literal: true # This tests the FileSet model that is inserted into the host app by hyrax:models # It includes the Hyrax::FileSetBehavior module and nothing else # So this test covers both the FileSetBehavior module and the generated FileSet model RSpec.describe FileSet, :active_fedora do include Hyrax...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/sipity_spec.rb
Ruby
apache-2.0
197
main
7,346
# frozen_string_literal: true RSpec.describe Sipity do describe '.Agent' do it 'will convert a Sipity::Agent' do object = Sipity::Agent.new expect(described_class.Agent(object)).to eq(object) end it 'will convert an object that responds to #to_sipity_agent' do object = double(to_sipity_...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/batch_upload_item_spec.rb
Ruby
apache-2.0
197
main
210
# frozen_string_literal: true RSpec.describe BatchUploadItem do describe ".human_readable_type" do subject { described_class.human_readable_type } it { is_expected.to eq 'Works by Batch' } end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/models/flipflop_spec.rb
Ruby
apache-2.0
197
main
1,737
# frozen_string_literal: true RSpec.describe Flipflop do describe "assign_admin_set?" do subject { described_class.assign_admin_set? } it "defaults to true" do is_expected.to be true end end describe "proxy_deposit?" do subject { described_class.proxy_deposit? } it "defaults to true" ...