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/services/hyrax/permission_manager_spec.rb
Ruby
apache-2.0
197
main
6,792
# frozen_string_literal: true RSpec.describe Hyrax::PermissionManager do subject(:manager) { described_class.new(resource: resource) } let(:custom_group) { 'my_group_id' } let(:other_user) { create(:user).user_key.to_s } let(:public_group) { 'public' } let(:resource) { valkyrie_create(:hyrax_resource)...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/derivative_service_spec.rb
Ruby
apache-2.0
197
main
1,156
# frozen_string_literal: true require 'hyrax/specs/shared_specs' # NOTE: This service class is marked for deprecation. The new Hyrax::FileSetDerivativesService is preferred and can handle # both ActiveFedora and Valkyrie objects. RSpec.describe Hyrax::DerivativeService, :active_fedora do let(:valid_file_set) { Fil...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/multiple_membership_checker_spec.rb
Ruby
apache-2.0
197
main
15,237
# frozen_string_literal: true RSpec.describe Hyrax::MultipleMembershipChecker, :clean_repo do let(:item) { FactoryBot.valkyrie_create(:hyrax_work, depositor: user.user_key) } let(:user) { FactoryBot.create(:user) } describe '#initialize' do it 'exposes an attr_reader' do expect(described_class.new(item...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/file_set_csv_service_spec.rb
Ruby
apache-2.0
197
main
2,943
# frozen_string_literal: true RSpec.describe Hyrax::FileSetCsvService, :clean_repo do let(:file) { create(:uploaded_file, file: File.open('spec/fixtures/sample-file.pdf')) } let(:file_metadata) { valkyrie_create(:file_metadata, :original_file, :with_file, file: file, mime_type: 'application/pdf') } let(:file_set)...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/batch_create_success_service_spec.rb
Ruby
apache-2.0
197
main
545
# frozen_string_literal: true RSpec.describe Hyrax::BatchCreateSuccessService do let(:depositor) { create(:user) } let(:inbox) { depositor.mailbox.inbox } describe "#call" do subject { described_class.new(depositor) } it "sends passing mail" do subject.call expect(inbox.count).to eq(1) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/visibility_writer_spec.rb
Ruby
apache-2.0
197
main
1,649
# frozen_string_literal: true RSpec.describe Hyrax::VisibilityWriter do subject(:writer) { described_class.new(resource: resource) } let(:resource) { Hyrax::Resource.new } let(:open) { writer.visibility_map.visibilities.first } let(:auth) { writer.visibility_map.visibilities[1] } let(:restricte...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/file_set_visibility_propagator_spec.rb
Ruby
apache-2.0
197
main
1,951
# frozen_string_literal: true RSpec.describe Hyrax::FileSetVisibilityPropagator, :active_fedora do subject(:propagator) { described_class.new(source: work) } let(:work) { FactoryBot.create(:work_with_files) } context 'a public work' do before do work.visibility = Hydra::AccessControls::Acces...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/resource_visibility_propagator_spec.rb
Ruby
apache-2.0
197
main
2,550
# frozen_string_literal: true RSpec.describe Hyrax::ResourceVisibilityPropagator do subject(:propagator) { described_class.new(source: work) } let(:queries) { Hyrax.custom_queries } let(:work) { FactoryBot.valkyrie_create(:hyrax_work, :with_member_file_sets) } let(:file_sets) { queries.fi...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/default_middleware_stack_spec.rb
Ruby
apache-2.0
197
main
1,218
# frozen_string_literal: true RSpec.describe Hyrax::DefaultMiddlewareStack do let(:work) { GenericWork.new } let(:user) { double(current_user: double) } describe '.build_stack' do subject { described_class.build_stack } it "has the correct stack frames" do expect(subject.middlewares).to eq [ ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/form_factory_spec.rb
Ruby
apache-2.0
197
main
710
# frozen_string_literal: true RSpec.describe Hyrax::FormFactory do subject(:factory) { described_class.new } let(:model) { FactoryBot.build(:hyrax_work) } describe '.build' do let(:ability) { :FAKE_ABILITY } let(:controller) { :FAKE_CONTROLLER } it 'returns a change set' do expect(fa...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/work_uploads_handler_spec.rb
Ruby
apache-2.0
197
main
6,401
# frozen_string_literal: true require 'hyrax/specs/spy_listener' require 'hyrax/specs/shared_specs/simple_work' RSpec.describe Hyrax::WorkUploadsHandler, valkyrie_adapter: :test_adapter do subject(:service) { described_class.new(work: work) } let(:uploads) { FactoryBot.create_list(:uploaded_file, 3) } let(:work...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/characterization/file_set_description_spec.rb
Ruby
apache-2.0
197
main
2,367
# frozen_string_literal: true RSpec.describe Hyrax::Characterization::FileSetDescription, valkyrie_adapter: :test_adapter do subject(:description) { described_class.new(file_set: file_set) } let(:ctype) { 'image/png' } let(:file) { Rack::Test::UploadedFile.new('spec/fixtures/world.png', ctype) } let(:file_set...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/characterization/valkyrie_characterization_service_spec.rb
Ruby
apache-2.0
197
main
1,596
# frozen_string_literal: true require 'spec_helper' require 'hyrax/specs/spy_listener' RSpec.describe Hyrax::Characterization::ValkyrieCharacterizationService do describe "run" do let(:characterizer) { double(characterize: fits_response) } let(:fits_response) { IO.read('spec/fixtures/png_fits.xml') } let...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/flexible_schema_validators/existing_records_validator_spec.rb
Ruby
apache-2.0
197
main
5,709
# frozen_string_literal: true RSpec.describe Hyrax::FlexibleSchemaValidators::ExistingRecordsValidator do subject(:validator) { described_class.new(profile, required_classes, errors) } let(:profile) { {} } let(:required_classes) { ['AdminSet', 'Collection', 'FileSet'] } let(:errors) { [] } before do st...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/flexible_schema_validators/core_metadata_validator_spec.rb
Ruby
apache-2.0
197
main
10,672
# frozen_string_literal: true RSpec.describe Hyrax::FlexibleSchemaValidators::CoreMetadataValidator do subject(:service) { described_class.new(profile: profile, errors: errors) } let(:profile) { YAML.safe_load_file(yaml) } let(:yaml) { Hyrax::Engine.root.join('spec', 'fixtures', 'files', 'm3_profile.yaml').to_s ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/flexible_schema_validators/class_validator_spec.rb
Ruby
apache-2.0
197
main
6,762
# frozen_string_literal: true RSpec.describe Hyrax::FlexibleSchemaValidators::ClassValidator do subject(:validator) { described_class.new(profile, required_classes, errors) } let(:profile) { {} } let(:required_classes) { ['AdminSetResource', 'CollectionResource', 'Hyrax::FileSet'] } let(:errors) { [] } des...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/query_service_spec.rb
Ruby
apache-2.0
197
main
3,084
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::QueryService, :clean_repo, :active_fedora do let(:service) { described_class.new } describe "#count" do let!(:work) { create(:generic_work) } subject { service.count } it { is_expected.to eq 1 } end describe "find_by_date_created" d...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/system_stats_spec.rb
Ruby
apache-2.0
197
main
1,460
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::SystemStats do let(:user1) { create(:user) } let(:start_date) { nil } let(:end_date) { nil } describe ".recent_users" do let!(:user2) { create(:user) } let(:two_days_ago_date) { 2.days.ago.beginning_of_day } let(:one_day_ago_date) { 1...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/file_sets/by_format_spec.rb
Ruby
apache-2.0
197
main
2,940
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::FileSets::ByFormat, :clean_repo, valkyrie_adapter: :test_adapter, index_adapter: :solr_index do describe ".query" do let(:file1) { Rack::Test::UploadedFile.new('spec/fixtures/small_file.txt', 'text/plain') } let(:file2) { Rack::Test::UploadedFile...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/collections/over_time_spec.rb
Ruby
apache-2.0
197
main
421
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Collections::OverTime do subject(:service) { described_class.new } describe "#points", :clean_repo do before { FactoryBot.valkyrie_create(:hyrax_collection) } it "is a list of points" do expect(service.points.size).to eq 5 expect(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/users/over_time_spec.rb
Ruby
apache-2.0
197
main
715
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Users::OverTime do before do create(:user, created_at: 3.days.ago) create(:user, created_at: 1.week.ago) create(:user, created_at: 1.week.ago) create(:user, created_at: 2.weeks.ago) end let(:instance) do described_class.new(delta...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/depositors/summary_spec.rb
Ruby
apache-2.0
197
main
2,435
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Depositors::Summary, :clean_repo, index_adapter: :solr_index do let(:user1) { create(:user) } let(:user2) { create(:user) } let(:two_days_ago_date) { Time.zone.now - 2.days } let(:start_date) { nil } let(:end_date) { nil } let!(:old_work) { v...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/works/by_depositor_spec.rb
Ruby
apache-2.0
197
main
591
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Works::ByDepositor do describe ".query", :clean_repo do let(:user1) { create(:user) } let(:user2) { create(:user) } before do 3.times do valkyrie_create(:hyrax_work, depositor: user1.user_key) end valkyrie_create(:...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/works/count_spec.rb
Ruby
apache-2.0
197
main
2,593
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Works::Count do describe ".by_permission", :clean_repo do let(:user1) { build(:user, id: 1) } let(:yesterday) { 1.day.ago } let(:wings_disabled) { Hyrax.config.disable_wings } before do if wings_disabled valkyrie_create(:mo...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/statistics/works/by_resource_type_spec.rb
Ruby
apache-2.0
197
main
1,459
# frozen_string_literal: true RSpec.describe Hyrax::Statistics::Works::ByResourceType do let(:service) { described_class.new } let(:user) { create(:user) } describe "#query", :clean_repo do before do if Hyrax.config.use_valkyrie? FactoryBot.valkyrie_create(:monograph, title: ['test 1'], resourc...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/identifier/registrar_spec.rb
Ruby
apache-2.0
197
main
1,048
# frozen_string_literal: true RSpec.describe Hyrax::Identifier::Registrar do subject(:registrar) { described_class.new(builder: :NOT_A_REAL_BUILDER) } it 'is abstract' do expect { registrar.register!(object: :NOT_A_REAL_OBJECT) } .to raise_error NotImplementedError end describe '.for' do let(:b...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/identifier/builder_spec.rb
Ruby
apache-2.0
197
main
1,126
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Identifier::Builder do subject(:builder) { described_class.new } it_behaves_like 'a Hyrax::Identifier::Builder' describe '#prefix' do it 'has a default prefix' do expect(builder.prefix).not_to be_empty end ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/identifier/dispatcher_spec.rb
Ruby
apache-2.0
197
main
2,122
# frozen_string_literal: true RSpec.describe Hyrax::Identifier::Dispatcher do subject(:dispatcher) { described_class.new(registrar: fake_registrar.new) } let(:identifier) { 'moomin/123/abc' } let(:object) { FactoryBot.build(:monograph) } let(:fake_registrar) do Class.new do def initializ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/nested_collection_query_service_spec.rb
Ruby
apache-2.0
197
main
8,748
# frozen_string_literal: true RSpec.describe Hyrax::Collections::NestedCollectionQueryService, clean_repo: true do let(:blacklight_config) { CatalogController.blacklight_config } let(:repository) { Blacklight::Solr::Repository.new(blacklight_config) } let(:user) { create(:user) } let(:ability) { ::Ability.new(u...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/nested_collection_persistence_service_spec.rb
Ruby
apache-2.0
197
main
1,215
# frozen_string_literal: true RSpec.describe Hyrax::Collections::NestedCollectionPersistenceService do let(:parent) { FactoryBot.valkyrie_create(:hyrax_collection) } let(:child) { FactoryBot.valkyrie_create(:hyrax_collection) } describe '.persist_nested_collection_for' do subject { described_class.persist_ne...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/collection_member_search_service_spec.rb
Ruby
apache-2.0
197
main
1,510
# frozen_string_literal: true RSpec.describe Hyrax::Collections::CollectionMemberSearchService, clean_repo: true do subject(:builder) do described_class.new(scope: scope, collection: nestable_collection, params: { "id" => nestable_collection.id.to_s }) end let(:current_ability) { instance_double(Ability, adm...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/collection_member_service_spec.rb
Ruby
apache-2.0
197
main
18,076
# frozen_string_literal: true require 'hyrax/specs/spy_listener' RSpec.describe Hyrax::Collections::CollectionMemberService, clean_repo: true do let(:custom_query_service) { Hyrax.custom_queries } let(:user) { create(:user) } let(:listener) { Hyrax::Specs::SpyListener.new } before { Hyrax.publisher.subscribe(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/managed_collections_service_spec.rb
Ruby
apache-2.0
197
main
529
# frozen_string_literal: true RSpec.describe Hyrax::Collections::ManagedCollectionsService do let(:scope) { FakeSearchBuilderScope.new(current_ability: current_ability) } let(:current_ability) { instance_double(Ability, admin?: true) } describe '.managed_collections_count' do it 'returns number of collection...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/permissions_create_service_spec.rb
Ruby
apache-2.0
197
main
3,927
# frozen_string_literal: true RSpec.describe Hyrax::Collections::PermissionsCreateService do let(:user) { FactoryBot.create(:user) } let(:user2) { FactoryBot.create(:user) } let(:query_service) { Hyrax.query_service } describe ".create_default" do let(:collection_type) { FactoryBot.create(:collection_type)...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collections/permissions_service_spec.rb
Ruby
apache-2.0
197
main
16,969
# frozen_string_literal: true RSpec.describe Hyrax::Collections::PermissionsService do subject(:service) { described_class } let(:user) { FactoryBot.create(:user) } let(:ability) { Ability.new(user) } context 'methods querying individual collections' do let(:collection) do FactoryBot.valkyrie_create(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/status_list_service_spec.rb
Ruby
apache-2.0
197
main
2,342
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::StatusListService do subject(:service) { described_class.new(user, "workflow_state_name_ssim:initial") } let(:user) { FactoryBot.create(:user) } context 'using valkyrie models', index_adapter: :solr_index, valkyrie_adapter: :test_a...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/notification_configuration_parameter_spec.rb
Ruby
apache-2.0
197
main
1,157
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe NotificationConfigurationParameter do describe '#build_from_workflow_action_configuration' do let(:config) do { name: 'name_of_notification', notification_type: Sipity::Notification::NOTIFICATION_TYPE_EMA...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/activate_object_spec.rb
Ruby
apache-2.0
197
main
634
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Workflow::ActivateObject do let(:work) { FactoryBot.valkyrie_create(:hyrax_work, state: Hyrax::ResourceStatus::INACTIVE) } let(:user) { FactoryBot.create(:user) } subject(:workflow_method) { described_class } it_behaves_li...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/workflow_importer_spec.rb
Ruby
apache-2.0
197
main
9,230
# frozen_string_literal: true require "spec_helper" RSpec.describe Hyrax::Workflow::WorkflowImporter, :clean_repo do let(:permission_template) { create(:permission_template) } let(:data) do { workflows: [ { name: "ulra_submission", label: "This is the label", descrip...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/revoke_edit_from_depositor_spec.rb
Ruby
apache-2.0
197
main
2,161
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Workflow::RevokeEditFromDepositor do subject(:workflow_method) { described_class } let(:change_set) { Hyrax::ChangeSet.for(work) } let(:depositor) { FactoryBot.create(:user) } let(:editors) { [depositor.user_key] } let(:us...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/deactivate_object_spec.rb
Ruby
apache-2.0
197
main
636
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Workflow::DeactivateObject do let(:work) { FactoryBot.valkyrie_create(:hyrax_work, state: Hyrax::ResourceStatus::ACTIVE) } let(:user) { FactoryBot.create(:user) } subject(:workflow_method) { described_class } it_behaves_li...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/permission_query_spec.rb
Ruby
apache-2.0
197
main
15,082
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe PermissionQuery, slow_test: true do let(:reviewing_user) { create(:user) } let(:completing_user) { create(:user) } let(:workflow_config) do { workflows: [{ name: 'testing', actions...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/deposited_notification_spec.rb
Ruby
apache-2.0
197
main
2,104
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::DepositedNotification do let(:approver) { FactoryBot.create(:user) } let(:depositor) { FactoryBot.create(:user) } let(:to_user) { FactoryBot.create(:user) } let(:cc_user) { FactoryBot.create(:user) } let(:work) do if Hyrax.config.disable_wings ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
Ruby
apache-2.0
197
main
1,347
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe SipityActionsGenerator do let(:workflow) { Sipity::Workflow.new(name: 'Hello') } let(:actions_configuration) do [ { name: "start_a_submission", transition_to: "new", emails: [ { name: ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/workflow_schema_spec.rb
Ruby
apache-2.0
197
main
2,531
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe WorkflowSchema do subject(:schema) { described_class.new } let(:valid_data) do { workflows: [ { name: "valid", allows_access_grant: true, actions: [ ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/changes_required_notification_spec.rb
Ruby
apache-2.0
197
main
2,147
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::ChangesRequiredNotification do let(:approver) { create(:user) } let(:depositor) { create(:user) } let(:to_user) { create(:user) } let(:cc_user) { create(:user) } let(:work) do if Hyrax.config.disable_wings valkyrie_create(:monograph, titl...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/action_taken_service_spec.rb
Ruby
apache-2.0
197
main
3,939
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::ActionTakenService do let(:triggered_methods) { [instance_double(Sipity::Method, service_name: 'SpyAction')] } let(:triggered_methods_rel) do double('Sipity::Method::ActiveRecord_Relation', order: triggered_methods, any?: true) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/grant_edit_to_depositor_spec.rb
Ruby
apache-2.0
197
main
2,129
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Workflow::GrantEditToDepositor do subject(:workflow_method) { described_class } let(:change_set) { Hyrax::ChangeSet.for(work) } let(:depositor) { FactoryBot.create(:user) } let(:user) { User.new } it_behaves_like 'a Hyrax...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/notification_service_spec.rb
Ruby
apache-2.0
197
main
3,288
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::NotificationService do let(:creating_user) { Sipity::Role.new(name: 'creating_user') } let(:recipient1) do Sipity::NotificationRecipient.new(recipient_strategy: 'to', role: creating_user) end let(:advising) {...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/state_machine_generator_spec.rb
Ruby
apache-2.0
197
main
1,630
# frozen_string_literal: true module Hyrax RSpec.describe Workflow::StateMachineGenerator do let(:workflow) { create(:workflow, name: 'hello') } let(:action_name) { 'do_it' } let(:config) do { from_states: [ { names: ["pending_student_completion"], roles: ['creating_user'] }, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/method_generator_spec.rb
Ruby
apache-2.0
197
main
1,819
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::MethodGenerator do describe ".call" do let(:workflow_action) { create(:workflow_action) } let(:method_list) { ['one', 'two'] } subject { described_class.call(action: workflow_action, list: method_list) } context "when there are no existin...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/notification_generator_spec.rb
Ruby
apache-2.0
197
main
1,288
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe NotificationGenerator do let(:workflow) { create(:workflow) } let(:recipients) { { to: 'creating_user', cc: 'advising', bcc: "data_observing" } } context '#call' do context 'with for a workflow action' do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/pending_review_notification_spec.rb
Ruby
apache-2.0
197
main
2,139
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::PendingReviewNotification do let(:depositor) { create(:user) } let(:to_user) { create(:user) } let(:cc_user) { create(:user) } let(:work) do if Hyrax.config.disable_wings valkyrie_create(:monograph, title: ["Test title"], depositor: deposit...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/object_in_workflow_decorator_spec.rb
Ruby
apache-2.0
197
main
379
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::ObjectInWorkflowDecorator do subject(:decorator) { described_class.new(resource) } let(:resource) { FactoryBot.valkyrie_create(:hyrax_work) } it { is_expected.not_to be_published } describe '#workflow_state' do it 'is unknown' do expect(d...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/workflow_permissions_generator_spec.rb
Ruby
apache-2.0
197
main
1,373
# frozen_string_literal: true require "spec_helper" module Hyrax module Workflow RSpec.describe WorkflowPermissionsGenerator do let(:workflow) { Sipity::Workflow.new(name: 'Hello') } let(:workflow_permissions_configuration) do [ { role: "work_submitting" }, { role: "etd_re...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/actionable_objects_spec.rb
Ruby
apache-2.0
197
main
3,720
# frozen_string_literal: true RSpec.describe Hyrax::Workflow::ActionableObjects do subject(:service) { described_class.new(user: user) } let(:user) { FactoryBot.create(:user) } describe '#each' do it 'is empty by default' do expect(service.each).to be_none end context 'with objects in workflo...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/permission_generator_spec.rb
Ruby
apache-2.0
197
main
2,192
# frozen_string_literal: true module Hyrax module Workflow RSpec.describe PermissionGenerator do let(:user) { create(:user) } let(:role) { Sipity::Role.find_or_create_by!(name: 'creating_user') } let(:workflow) { create(:workflow, name: 'workflow') } let(:workflow_state) { workflow.initial...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/grant_read_to_depositor_spec.rb
Ruby
apache-2.0
197
main
2,225
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Workflow::GrantReadToDepositor do subject(:workflow_method) { described_class } let(:change_set) { Hyrax::ChangeSet.for(work) } let(:depositor) { FactoryBot.create(:user) } let(:user) { User.new } it_behaves_like 'a Hyrax...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/workflow/workflow_factory_spec.rb
Ruby
apache-2.0
197
main
2,237
# frozen_string_literal: true require 'rails_helper' RSpec.describe Hyrax::Workflow::WorkflowFactory do subject(:factory) { described_class } let(:attributes) { {} } let(:deposit_action) { Sipity::WorkflowAction.create!(workflow: workflow, name: 'start') } let(:permission_template) { Hyrax::PermissionTemplate...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collection_types/create_service_spec.rb
Ruby
apache-2.0
197
main
5,753
# frozen_string_literal: true RSpec.describe Hyrax::CollectionTypes::CreateService do describe '.create_collection_type' do it 'create collection type with default options when no options are received' do # rubocop:disable RSpec/ExampleLength described_class.create_collection_type(machine_id: 'custom_type',...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/collection_types/permissions_service_spec.rb
Ruby
apache-2.0
197
main
12,571
# frozen_string_literal: true RSpec.describe Hyrax::CollectionTypes::PermissionsService do let(:user_cg) { FactoryBot.create(:user, groups: 'create_group') } let(:user_mg) { FactoryBot.create(:user, groups: 'manage_group') } let(:user_cu) { FactoryBot.create(:user) } let(:user_mu) { FactoryBot.create(:user) } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/file_metadata_listener_spec.rb
Ruby
apache-2.0
197
main
2,218
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::FileMetadataListener, valkyrie_adapter: :test_adapter do subject(:listener) { described_class.new } let(:data) { { metadata: metadata, user: user } } let(:event) { Dry::Events::Event.new(event_type, data) } let(:fake_adapter) { FakeI...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/workflow_listener_spec.rb
Ruby
apache-2.0
197
main
3,761
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::WorkflowListener do subject(:listener) { described_class.new } let(:data) { { object: resource, user: user } } let(:event) { Dry::Events::Event.new(event_type, data) } let(:resource) { FactoryBot.valkyrie_create(:hyrax_work) } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/file_set_lifecycle_notification_listener_spec.rb
Ruby
apache-2.0
197
main
3,872
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::FileSetLifecycleNotificationListener do subject(:listener) { described_class.new } let(:data) { { result: :success } } let(:event) { Dry::Events::Event.new(event_type, data) } let(:inbox) { user.mailbox.inbox } let(:user) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/acl_index_listener_spec.rb
Ruby
apache-2.0
197
main
1,166
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::ACLIndexListener do subject(:listener) { described_class.new } let(:acl) { Hyrax::AccessControlList.new(resource: resource) } let(:data) { { result: result, resource: resource, acl: acl } } let(:event) { Dry::Events::Event.n...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/member_cleanup_listener_spec.rb
Ruby
apache-2.0
197
main
2,056
# frozen_string_literal: true require 'hyrax/specs/spy_listener' RSpec.describe Hyrax::Listeners::MemberCleanupListener do subject(:listener) { described_class.new } let(:data) { { collection: collection, user: user } } let(:event) { Dry::Events::Event.new(event_type, data) } let(:user) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/metadata_index_listener_spec.rb
Ruby
apache-2.0
197
main
6,587
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::MetadataIndexListener do subject(:listener) { described_class.new } let(:data) { { object: resource } } let(:event) { Dry::Events::Event.new(event_type, data) } let(:fake_adapter) { FakeIndexingAdapter.new } let(:resource) { Fa...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/proxy_deposit_listener_spec.rb
Ruby
apache-2.0
197
main
837
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::ProxyDepositListener do subject(:listener) { described_class.new } let(:data) { { object: resource, user: depositor } } let(:depositor) { FactoryBot.create(:user) } let(:event) { Dry::Events::Event.new(event_type, data) } let(:p...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/listeners/batch_notification_listener_spec.rb
Ruby
apache-2.0
197
main
914
# frozen_string_literal: true RSpec.describe Hyrax::Listeners::BatchNotificationListener do subject(:listener) { described_class.new } describe '#on_batch_created' do let(:user) { create(:user) } let(:data) { { result: :success, user: user, messages: [] } } let(:event) { Dry::Events::Event.new(:on_b...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_file_metadata_spec.rb
Ruby
apache-2.0
197
main
6,499
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindFileMetadata, valkyrie_adapter: :test_adapter do let(:query_service) { Valkyrie::MetadataAdapter.find(:test_adapter).query_service } subject(:query_handler) { described_class.new(query_service: query_service) } describe '.queries' do it '...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_collections_by_type_spec.rb
Ruby
apache-2.0
197
main
1,683
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindCollectionsByType, valkyrie_adapter: :test_adapter, skip: !Hyrax.config.use_valkyrie? || !Hyrax.config.disable_wings do subject(:query_handler) { described_class.new(query_service: query_service) } let(:adapter) { Valkyrie::MetadataAda...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_by_property_value_spec.rb
Ruby
apache-2.0
197
main
3,615
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindByPropertyValue, :clean_repo do subject(:query_handler) { described_class.new(query_service: Hyrax.query_service) } let(:resources) { [resource1, resource2, resource3] } # Title contains quotes and special characters to test string escaping ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_ids_by_model_spec.rb
Ruby
apache-2.0
197
main
1,539
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindIdsByModel, :clean_repo do subject(:query_handler) { described_class.new(query_service: Hyrax.query_service) } shared_examples 'find_ids_by_model' do |use_solr| it 'finds ids matching the model' do expect(query_handler.find_ids_by_mod...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_access_control_spec.rb
Ruby
apache-2.0
197
main
2,396
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindAccessControl, skip: !Hyrax.config.disable_wings do subject(:query_handler) { described_class.new(query_service: query_service) } let(:adapter) { Hyrax.metadata_adapter } let(:persister) { adapter.persister } let(:query_ser...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/find_many_by_alternate_ids_spec.rb
Ruby
apache-2.0
197
main
1,452
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::FindManyByAlternateIds do subject(:query_handler) { described_class.new(query_service: query_service) } let(:adapter) { Valkyrie::MetadataAdapter.find(:test_adapter) } let(:persister) { adapter.persister } let(:query_service) ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/collection_members_spec.rb
Ruby
apache-2.0
197
main
1,594
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::CollectionMembers, valkyrie_adapter: :test_adapter do subject(:query_handler) { described_class.new(query_service: query_service) } let(:adapter) { Hyrax.metadata_adapter } let(:persister) { adapter.persister } let...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/parent_collections_navigator_spec.rb
Ruby
apache-2.0
197
main
1,447
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::ParentCollectionsNavigator, :clean_repo do let(:custom_query_service) { Hyrax.custom_queries } let!(:collection1) do FactoryBot.valkyrie_create(:hyrax_collection, title: ['Parent Collection 1'], ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/child_file_sets_navigator_spec.rb
Ruby
apache-2.0
197
main
1,248
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator, :clean_repo do let(:custom_query_service) { Hyrax.custom_queries } let(:work1) { valkyrie_create(:hyrax_work, title: ['Work 1']) } let(:work2) { valkyrie_create(:hyrax_work, title: ['Child Work 1']) } l...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/find_files_spec.rb
Ruby
apache-2.0
197
main
4,161
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::FindFiles, valkyrie_adapter: :test_adapter do subject(:query_handler) do described_class.new(query_service: Hyrax.query_service) end describe '#find_files' do context 'when files exist' do let(:file_metadata1) { FactoryB...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/child_works_navigator_spec.rb
Ruby
apache-2.0
197
main
2,587
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::ChildWorksNavigator, :clean_repo do let(:custom_query_service) { Hyrax.custom_queries } let(:collection1) { valkyrie_create(:hyrax_collection, title: ['Collection 1']) } let(:collection2) { valkyrie_create(:hyrax_collection, tit...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/child_collections_navigator_spec.rb
Ruby
apache-2.0
197
main
1,263
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::ChildCollectionsNavigator, :clean_repo do let(:custom_query_service) { Hyrax.custom_queries } let(:collection1) { valkyrie_create(:hyrax_collection, title: ['Collection 1']) } let(:collection2) { valkyrie_create(:hyrax_collectio...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/custom_queries/navigators/parent_work_navigator_spec.rb
Ruby
apache-2.0
197
main
4,001
# frozen_string_literal: true RSpec.describe Hyrax::CustomQueries::Navigators::ParentWorkNavigator, valkyrie_adapter: :test_adapter, clean_repo: true do let!(:parent_work) { FactoryBot.valkyrie_create(:hyrax_work, id: 'pw1', title: ['Parent Work 1'], member_ids: member_ids) } let(:child_work1) { FactoryBot.valkyri...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/works/managed_works_service_spec.rb
Ruby
apache-2.0
197
main
489
# frozen_string_literal: true RSpec.describe Hyrax::Works::ManagedWorksService, clean_repo: true do let(:current_ability) { instance_double(Ability, admin?: true) } let(:scope) { FakeSearchBuilderScope.new(current_ability: current_ability) } describe '.managed_works_count' do let!(:work) { valkyrie_create(:m...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/works/migration_service_spec.rb
Ruby
apache-2.0
197
main
1,550
# frozen_string_literal: true # rubocop:disable RSpec/InstanceVariable RSpec.describe Hyrax::Works::MigrationService, :active_fedora, clean_repo: true do let(:predicate_from) { ::RDF::Vocab::DC11.description } let(:predicate_to) { ::RDF::Vocab::SCHEMA.description } let(:predicate_from2) { ::RDF::Vocab::DC.rights ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/services/hyrax/riiif/file_resolver_spec.rb
Ruby
apache-2.0
197
main
920
# frozen_string_literal: true require 'spec_helper' RSpec.describe Hyrax::Riiif::FileResolver do let(:resolver) { described_class.new } context 'with a file' do let(:file_metadata) { FactoryBot.valkyrie_create(:hyrax_file_metadata, :with_file) } let(:file_set) { Hyrax.query_service.find_by(id: file_metada...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/api_route_spec.rb
Ruby
apache-2.0
197
main
3,043
# frozen_string_literal: true RSpec.describe 'routing and paths', type: :routing do routes { Hyrax::Engine.routes } let(:item_id) { '123' } describe 'Arkivo' do context 'with a constraint defined' do before do allow(Hyrax::ArkivoConstraint).to receive(:matches?) { false } end it '...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/featured_works_route_spec.rb
Ruby
apache-2.0
197
main
660
# frozen_string_literal: true RSpec.describe "file routes", type: :routing do routes { Hyrax::Engine.routes } it 'creates a featured_work' do expect(post: '/works/7/featured_work').to route_to(controller: 'hyrax/featured_works', action: 'create', id: '7') end it 'removes a featured_work' do expect(dele...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/citations_route_spec.rb
Ruby
apache-2.0
197
main
801
# frozen_string_literal: true RSpec.describe "citations routes", type: :routing do routes { Hyrax::Engine.routes } context "for works" do it 'routes to the controller' do expect(get: '/works/7/citation').to route_to(controller: 'hyrax/citations', action: 'work', id: '7') end it 'builds a url' do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/stats_route_spec.rb
Ruby
apache-2.0
197
main
769
# frozen_string_literal: true RSpec.describe "stats routes", type: :routing do routes { Hyrax::Engine.routes } context "for works" do it 'routes to the controller' do expect(get: '/works/7/stats').to route_to(controller: 'hyrax/stats', action: 'work', id: '7') end it 'builds a url' do expec...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/collection_permission_templates_routes_spec.rb
Ruby
apache-2.0
197
main
1,517
# frozen_string_literal: true RSpec.describe 'Collection Permission Templates Routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes to #create' do expect(post: '/dashboard/collections/1/permission_template').to route_to(controller: 'hyrax/admin/permission_templates', action: 'create', collectio...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/dashboard_routes_spec.rb
Ruby
apache-2.0
197
main
1,705
# frozen_string_literal: true RSpec.describe 'Dashboard Routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes GET /dashboard/collections/:parent_id/under' do expect(get: '/dashboard/collections/parent1/under').to route_to(controller: 'hyrax/dashboard/nest_collections', action: 'create_collectio...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/route_spec.rb
Ruby
apache-2.0
197
main
7,247
# frozen_string_literal: true RSpec.describe 'Routes', type: :routing do routes { Hyrax::Engine.routes } describe 'Homepage' do it 'routes the root url to the homepage controller' do expect(get: '/').to route_to(controller: 'hyrax/homepage', action: 'index') end end describe "Fixity check" do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/resource_sync_spec.rb
Ruby
apache-2.0
197
main
730
# frozen_string_literal: true RSpec.describe 'ResourceSync Routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes the well-known uri' do expect(get: '/.well-known/resourcesync').to route_to(controller: 'hyrax/resource_sync', action: 'source_description') end it 'routes the capability list' ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/operations_spec.rb
Ruby
apache-2.0
197
main
380
# frozen_string_literal: true RSpec.describe 'Operations routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes the list view' do expect(get: '/users/77/operations').to route_to(controller: 'hyrax/operations', action: 'index', ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/ownership_transfers_route_spec.rb
Ruby
apache-2.0
197
main
2,019
# frozen_string_literal: true RSpec.describe "proxy deposit and transfers routing", type: :routing do routes { Hyrax::Engine.routes } it "lists transfers" do expect(transfers_path).to eq '/dashboard/transfers' expect(get: '/dashboard/transfers').to route_to(controller: 'hyrax/transfers', action: 'index') ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/single_use_link_spec.rb
Ruby
apache-2.0
197
main
1,287
# frozen_string_literal: true RSpec.describe 'Routes for single use links', type: :routing do routes { Hyrax::Engine.routes } describe 'Single Use Link Viewer' do it 'routes to #show' do expect(show_single_use_link_path('abc123')).to eq '/single_use_link/show/abc123' expect(get("/single_use_link/sh...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/collection_types_routes.rb
Ruby
apache-2.0
197
main
1,426
# frozen_string_literal: true RSpec.describe 'Collection Types Routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes to #index' do expect(get: '/admin/collection_types').to route_to(controller: 'hyrax/admin/collection_types', action: 'index') end it 'routes to #create' do expect(post: ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/routing/admin_routes_spec.rb
Ruby
apache-2.0
197
main
1,093
# frozen_string_literal: true RSpec.describe 'Admin Routes', type: :routing do routes { Hyrax::Engine.routes } it 'routes the appearance' do expect(get: '/admin/appearance').to route_to(controller: 'hyrax/admin/appearances', action: 'show') end it 'routes the statistics page' do expect(get: '/admin/st...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/helpers/hyrax_helper_spec.rb
Ruby
apache-2.0
197
main
17,867
# frozen_string_literal: true def new_state Blacklight::SearchState.new({}, CatalogController.blacklight_config) end RSpec.describe HyraxHelper, type: :helper do describe "show_transfer_request_title" do let(:sender) { FactoryBot.create(:user) } let(:user) { FactoryBot.create(:user) } context "when wo...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/helpers/hyrax/dashboard_helper_behavior_spec.rb
Ruby
apache-2.0
197
main
3,475
# frozen_string_literal: true RSpec.describe Hyrax::DashboardHelperBehavior, type: :helper do describe "#on_the_dashboard?" do it "returns false for controllers that aren't a part of the dashboard" do allow(helper).to receive(:params).and_return(controller: "foo") expect(helper).not_to be_on_the_dashb...