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 | .koppie/app/models/generic_work.rb | Ruby | apache-2.0 | 197 | main | 308 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWork`
class GenericWork < Hyrax::Work
if Hyrax.config.work_include_metadata?
include Hyrax::Schema(:core_metadata)
include Hyrax::Schema(:basic_metadata)
include Hyrax::Schema(:generic_work)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/app/models/monograph.rb | Ruby | apache-2.0 | 197 | main | 301 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource Monograph`
class Monograph < Hyrax::Work
if Hyrax.config.work_include_metadata?
include Hyrax::Schema(:core_metadata)
include Hyrax::Schema(:basic_metadata)
include Hyrax::Schema(:monograph)
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/app/models/ability.rb | Ruby | apache-2.0 | 197 | main | 753 | class Ability
include Hydra::Ability
include Hyrax::Ability
self.ability_logic += [:everyone_can_create_curation_concerns]
# Define any customized permissions here.
def custom_permissions
# Limits deleting objects to a the admin user
#
# if current_user.admin?
# can [:destroy], ActiveFedor... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/app/models/search_builder.rb | Ruby | apache-2.0 | 197 | main | 555 | # frozen_string_literal: true
class SearchBuilder < Blacklight::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior
# Add a filter query to restrict the search to documents the current user has access to
include Hydra::AccessControlsEnforcement
include Hyrax::SearchFilters
##
# @example Adding a... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/app/models/solr_document.rb | Ruby | apache-2.0 | 197 | main | 1,051 | # frozen_string_literal: true
class SolrDocument
include Blacklight::Solr::Document
include Blacklight::Gallery::OpenseadragonSolrDocument
# Adds Hyrax behaviors to the SolrDocument.
include Hyrax::SolrDocumentBehavior
# self.unique_key = 'id'
# Email uses the semantic field mappings below to generate t... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .koppie/app/models/concerns/bulkrax/has_local_processing.rb | Ruby | apache-2.0 | 197 | main | 278 | # frozen_string_literal: true
module Bulkrax::HasLocalProcessing
# This method is called during build_metadata
# add any special processing here, for example to reset a metadata property
# to add a custom property from outside of the import data
def add_local; end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings_helper.rb | Ruby | apache-2.0 | 197 | main | 237 | # frozen_string_literal: true
require 'spec_helper'
unless Hyrax.config.disable_wings
require 'wings'
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'wings', 'support', 'matchers', '**', '*.rb'))].each { |f| require f }
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/spec_helper.rb | Ruby | apache-2.0 | 197 | main | 16,725 | # frozen_string_literal: true
$VERBOSE = nil unless ENV['RUBY_LOUD'] # silence loud Ruby 2.7 deprecations
ENV['RAILS_ENV'] = 'test'
ENV['DATABASE_URL'] = ENV['DATABASE_TEST_URL'] if ENV['DATABASE_TEST_URL']
ENV.delete('APP_NAME') # Prevent custom test app names in specs
# Analytics is turned off by default
ENV['HYRAX_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings_spec.rb | Ruby | apache-2.0 | 197 | main | 736 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings'
RSpec.describe Wings, :active_fedora do
describe 'WorkSearchBuilder' do
it "does not pollute the class variables after separate calls" do
generic_work_search_builder = described_class::WorkSearchBuild... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/config/hyrax_events_spec.rb | Ruby | apache-2.0 | 197 | main | 1,659 | # frozen_string_literal: true
RSpec.describe "hyrax_events using Hyrax callbacks", :active_fedora do
let(:curation_concern) { create(:work) }
let(:file_set) { create(:file_set) }
let(:user) { create(:user) }
describe "after_create_concern" do
it "queues a ContentDepositEventJob" do
expect(ContentDepo... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/javascripts/jasmine_spec.rb | Ruby | apache-2.0 | 197 | main | 910 | # frozen_string_literal: true
require 'English'
# Run the jasmine tests by running the karma javascript test framework
# The spec will fail if any jasmine tests fails.
RSpec.describe "Jasmine" do
before do
`cd $RAILS_ROOT && bundle exec rake assets:precompile` if ENV['RAILS_ROOT']
end
it "expects all jasmin... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/orm_converter_spec.rb | Ruby | apache-2.0 | 197 | main | 2,715 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/orm_converter'
RSpec.describe Wings::OrmConverter, :active_fedora do
describe '.to_valkyrie_resource_class' do
context 'when given a ActiveFedora class (eg. a constant that responds to #properties)' do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/attribute_transformer_spec.rb | Ruby | apache-2.0 | 197 | main | 1,086 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings/attribute_transformer'
RSpec.describe Wings::AttributeTransformer, :active_fedora do
let(:id) { 'moomin123' }
let(:based_near) { Hyrax::ControlledVocabularies::Location.new("https://sws.geonames.org/4920808/") }
let(:work) { Gene... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/active_fedora_converter_spec.rb | Ruby | apache-2.0 | 197 | main | 20,326 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings'
require 'wings/active_fedora_converter'
RSpec.describe Wings::ActiveFedoraConverter, :active_fedora, :clean_repo do
subject(:converter) { described_class.new(resource: resource) }
let(:attributes) { { id: ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/model_transformer_spec.rb | Ruby | apache-2.0 | 197 | main | 14,988 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/model_transformer'
RSpec.describe Wings::ModelTransformer, :active_fedora, :clean_repo do
subject(:factory) { described_class.new(pcdm_object: pcdm_object) }
let(:pcdm_object) { work }
let(:adapter) { V... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/transformer_value_mapper_spec.rb | Ruby | apache-2.0 | 197 | main | 1,755 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings/transformer_value_mapper'
RSpec.describe Wings::TransformerValueMapper, :active_fedora do
subject(:mapper) { described_class.for(value) }
let(:value) { 'a value' }
let(:uri) { RDF::URI('http://ex... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/converter_value_mapper_spec.rb | Ruby | apache-2.0 | 197 | main | 610 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings/converter_value_mapper'
RSpec.describe Wings::ConverterValueMapper do
subject(:mapper) { described_class.for(value) }
let(:value) { 'a value' }
describe '.for' do
it 'returns a value mapper' do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/valkyrie/storage_spec.rb | Ruby | apache-2.0 | 197 | main | 5,510 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
RSpec.describe Wings::Valkyrie::Storage, :active_fedora, :clean_repo do
subject(:storage_adapter) { described_class.new }
let(:file) { fixture_file_upload('/world.png', 'image/png') }
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/valkyrie/persister_spec.rb | Ruby | apache-2.0 | 197 | main | 30,024 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
RSpec.describe Wings::Valkyrie::Persister, :active_fedora do
subject(:persister) { described_class.new(adapter: adapter) }
let(:adapter) { Wings::Valkyrie::MetadataAdapt... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/valkyrie/metadata_adapter_spec.rb | Ruby | apache-2.0 | 197 | main | 306 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
RSpec.describe Wings::Valkyrie::MetadataAdapter, :active_fedora do
let(:adapter) { described_class.new }
it_behaves_like "a Valkyrie::MetadataAdapter"
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/valkyrie/query_service_spec.rb | Ruby | apache-2.0 | 197 | main | 22,697 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
RSpec.describe Wings::Valkyrie::QueryService, :active_fedora, :clean_repo do
before do
module Hyrax::Test
module QueryService
class Book < ActiveFedora::B... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/valkyrie/resource_factory_spec.rb | Ruby | apache-2.0 | 197 | main | 2,524 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings'
RSpec.describe Wings::Valkyrie::ResourceFactory, :active_fedora do
subject(:factory) { described_class.new(adapter: adapter) }
let(:adapter) { Valkyrie::Persistence::Memory::MetadataAdapter.new }
let(:w... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/find_ids_by_model_spec.rb | Ruby | apache-2.0 | 197 | main | 2,721 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/services/custom_queries/find_ids_by_model'
RSpec.describe Wings::CustomQueries::FindIdsByModel, :clean_repo, valkyrie_adapter: :wings_adapter do
subject(:query_handler) { described_class.new(query_service: Hyra... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/find_many_by_alternate_ids_spec.rb | Ruby | apache-2.0 | 197 | main | 2,084 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/services/custom_queries/find_many_by_alternate_ids'
RSpec.describe Wings::CustomQueries::FindManyByAlternateIds, :active_fedora do
let(:query_service) { Hyrax.query_service }
let(:work1) { create(:public_wor... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/find_access_control_spec.rb | Ruby | apache-2.0 | 197 | main | 1,132 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/services/custom_queries/find_access_control'
RSpec.describe Wings::CustomQueries::FindAccessControl, :active_fedora do
subject(:query_handler) { described_class.new(query_service: query_service) }
let(:adapte... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/find_collections_by_type_spec.rb | Ruby | apache-2.0 | 197 | main | 1,781 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/services/custom_queries/find_collections_by_type'
RSpec.describe Wings::CustomQueries::FindCollectionsByType, :active_fedora, :clean_repo do
subject(:query_handler) { described_class.new(query_service: query_se... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/find_file_metadata_spec.rb | Ruby | apache-2.0 | 197 | main | 7,817 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/hydra/works/services/add_file_to_file_set'
require 'wings/services/custom_queries/find_file_metadata'
RSpec.describe Wings::CustomQueries::FindFileMetadata, :active_fedora, :clean_repo do
subject(:query_handler... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/navigators/child_collections_navigator_spec.rb | Ruby | apache-2.0 | 197 | main | 1,785 | # frozen_string_literal: true
RSpec.describe Hyrax::CustomQueries::Navigators::ChildCollectionsNavigator, :active_fedora, :clean_repo do
subject(:factory) { Wings::ModelTransformer.new(pcdm_object: pcdm_object) }
let(:resource) { subject.build }
let(:custom_query_service) { Hyrax.custom_queries }
let(:collecti... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/navigators/child_file_sets_navigator_spec.rb | Ruby | apache-2.0 | 197 | main | 1,637 | # frozen_string_literal: true
RSpec.describe Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator, :active_fedora, :clean_repo do
subject(:factory) { Wings::ModelTransformer.new(pcdm_object: pcdm_object) }
let(:resource) { subject.build }
let(:custom_query_service) { Hyrax.custom_queries }
let(:work1) {... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/services/custom_queries/navigators/child_works_navigator_spec.rb | Ruby | apache-2.0 | 197 | main | 2,996 | # frozen_string_literal: true
RSpec.describe Hyrax::CustomQueries::Navigators::ChildWorksNavigator, :active_fedora, :clean_repo do
subject(:factory) { Wings::ModelTransformer.new(pcdm_object: pcdm_object) }
let(:resource) { subject.build }
let(:custom_query_service) { Hyrax.custom_queries }
let(:collection1) ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/wings/hydra/works/services/add_file_to_file_set_spec.rb | Ruby | apache-2.0 | 197 | main | 5,375 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'wings_helper'
require 'wings/hydra/works/services/add_file_to_file_set'
RSpec.describe Wings::Works::AddFileToFileSet, :active_fedora, :clean_repo do
let(:af_file_set) { create(:file_set, id: 'fileset_id') }
let!(:file_set) ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/requests/legacy_routing_spec.rb | Ruby | apache-2.0 | 197 | main | 291 | # frozen_string_literal: true
RSpec.describe 'Legacy GenericFile routes', type: :request do
it 'redirects to the work' do
get '/files/gm80hv36p'
expect(response).to redirect_to("/concern/generic_works/gm80hv36p")
expect(response.code).to eq '301' # Moved Permanently
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/requests/riiif_spec.rb | Ruby | apache-2.0 | 197 | main | 2,206 | # frozen_string_literal: true
RSpec.describe 'IIIF image API', type: :request do
let(:wings_disabled) { Hyrax.config.disable_wings }
let(:user) { create(:user) }
let(:uploaded_file) { create(:uploaded_file, file: File.open('spec/fixtures/world.png')) }
let(:file_metadata) { valkyrie_create(:file_metadata, :orig... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/requests/blacklight_dynamic_sitemap/sitemap_spec.rb | Ruby | apache-2.0 | 197 | main | 3,941 | # frozen_string_literal: true
require 'rails_helper'
RSpec.shared_examples 'a sitemap' do
let(:xml) { Nokogiri::XML(response.body) }
let(:locs) { xml.xpath('//xmlns:loc', 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9').map(&:text) }
before do
solr = Blacklight.default_index.connection
solr.ad... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/validators/hyrax/collection_membership_validator_spec.rb | Ruby | apache-2.0 | 197 | main | 10,803 | # frozen_string_literal: true
RSpec.describe Hyrax::CollectionMembershipValidator do
subject(:validator) { described_class.new }
let(:work) { FactoryBot.build(:hyrax_work, :as_collection_member) }
let(:form) { Hyrax::Forms::ResourceForm(Monograph).new(resource: work) }
describe '#validate' do
it 'is valid... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax_spec.rb | Ruby | apache-2.0 | 197 | main | 3,544 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Hyrax do
describe '.logger' do
it 'is a Logger' do
expect(described_class.logger).to respond_to :log
end
end
describe '.schema_for' do
let(:field) { double('Field', name: :title) }
let(:non_flexible_klass) do
klass = ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/role_registry_spec.rb | Ruby | apache-2.0 | 197 | main | 1,764 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Hyrax::RoleRegistry do
let(:role_registry) { described_class.new }
describe '#role_names (without adding roles)' do
subject { role_registry.role_names }
it { is_expected.to eq(['approving', 'depositing', 'managing']) }
end
describe ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/move_all_works_to_admin_set_spec.rb | Ruby | apache-2.0 | 197 | main | 381 | # frozen_string_literal: true
require 'hyrax/move_all_works_to_admin_set'
RSpec.describe MoveAllWorksToAdminSet, :active_fedora, :clean_repo do
subject { described_class.run(admin_set) }
let(:admin_set) { create(:admin_set) }
let!(:work) { create(:work) }
it "moves the work into the admin set" do
subject... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/zotero_spec.rb | Ruby | apache-2.0 | 197 | main | 276 | # frozen_string_literal: true
RSpec.describe Hyrax::Zotero do
describe '.publications_url' do
let(:user_id) { 'foobar' }
it 'returns a string' do
expect(described_class.publications_url(user_id)).to eq "/users/#{user_id}/publications/items"
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/redis_event_store_spec.rb | Ruby | apache-2.0 | 197 | main | 1,882 | # frozen_string_literal: true
RSpec.describe Hyrax::RedisEventStore do
let(:redis_instance) { described_class.instance }
before do
redis_instance.keys('events:*').each { |key| redis_instance.del key }
end
describe "::create" do
subject { described_class.create("some action", "1234") }
context "wh... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/name_spec.rb | Ruby | apache-2.0 | 197 | main | 472 | # frozen_string_literal: true
RSpec.describe Hyrax::Name do
let(:name) { described_class.new(GenericWork) }
describe "route_key" do
subject { name.route_key }
it { is_expected.to eq 'hyrax_generic_works' }
end
describe "singular_route_key" do
subject { name.singular_route_key }
it { is_expec... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/analytics_spec.rb | Ruby | apache-2.0 | 197 | main | 3,315 | # frozen_string_literal: true
RSpec.describe Hyrax::Analytics, skip: 'deprecated analytics provider: google, use ga4 instead' do
before do
ENV['GOOGLE_ANALYTICS_ID'] = 'UA-XXXXXXXX'
ENV['GOOGLE_OAUTH_APP_NAME'] = 'My App Name'
ENV['GOOGLE_OAUTH_APP_VERSION'] = '0.0.1'
ENV['GOOGLE_OAUTH_PRIVATE_KEY_PA... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/configuration_spec.rb | Ruby | apache-2.0 | 197 | main | 7,246 | # frozen_string_literal: true
RSpec.describe Hyrax::Configuration do
subject(:configuration) { described_class.new }
describe '#register_roles' do
it 'yields a RoleRegistry' do
expect { |b| subject.register_roles(&b) }.to yield_with_args(kind_of(Hyrax::RoleRegistry))
end
end
it { is_expected.to d... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/arkivo_spec.rb | Ruby | apache-2.0 | 197 | main | 362 | # frozen_string_literal: true
RSpec.describe Hyrax::Arkivo do
describe '.config' do
it 'returns a hash with the :url key' do
expect(described_class.config).to have_key(:url)
end
end
describe '.new_subscription_url' do
it 'returns a string' do
expect(described_class.new_subscription_url).to... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/search_state_spec.rb | Ruby | apache-2.0 | 197 | main | 958 | # frozen_string_literal: true
RSpec.describe Hyrax::SearchState do
let(:controller) { CatalogController.new }
let(:config) { Blacklight::Configuration.new }
let(:state) { described_class.new({}, config, controller) }
describe "url_for_document" do
subject { state.url_for_document(document) }
context "... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/zotero/config_spec.rb | Ruby | apache-2.0 | 197 | main | 743 | # frozen_string_literal: true
RSpec.describe Hyrax::Zotero do
it { is_expected.to respond_to(:config) }
describe 'configuration' do
subject { described_class.reload_config! }
let(:client_key) { 'abc123' }
let(:client_secret) { '789xyz' }
before do
stub_const('ENV', 'ZOTERO_CLIENT_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/collections/search_service_spec.rb | Ruby | apache-2.0 | 197 | main | 1,396 | # frozen_string_literal: true
RSpec.describe Hyrax::Collections::SearchService do
let(:login) { 'vanessa' }
let(:session) { { history: [17, 14, 12, 9] } }
let(:service) { described_class.new(session, login) }
it "gets the documents for the first history entry" do
expect(Search).to receive(:find).with(17).a... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/arkivo/metadata_munger_spec.rb | Ruby | apache-2.0 | 197 | main | 1,535 | # frozen_string_literal: true
RSpec.describe Hyrax::Arkivo::MetadataMunger do
subject { described_class.new(metadata) }
let(:metadata) { JSON.parse(FactoryBot.json(:post_item))['metadata'] }
it 'makes camelCase symbols into underscored strings' do
expect(metadata).to include('resourceType', 'dateCreated', '... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/arkivo/create_subscription_job_spec.rb | Ruby | apache-2.0 | 197 | main | 2,060 | # frozen_string_literal: true
RSpec.describe Hyrax::Arkivo::CreateSubscriptionJob do
let(:user) { create(:user) }
context 'with a bogus user' do
before { allow(User).to receive(:find_by_user_key) { nil } }
it 'raises because user not found' do
expect { described_class.perform_now(user.user_key) }.to ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/arkivo/schema_validator_spec.rb | Ruby | apache-2.0 | 197 | main | 2,088 | # frozen_string_literal: true
RSpec.describe Hyrax::Arkivo::SchemaValidator do
let(:item) { JSON.parse(FactoryBot.json(:post_item)) }
it 'ensures a token is included' do
expect do
described_class.new(item.except('token')).call
end.to raise_error(Hyrax::Arkivo::InvalidItem, /required property of 'toke... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/arkivo/actor_spec.rb | Ruby | apache-2.0 | 197 | main | 3,023 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
RSpec.describe Hyrax::Arkivo::Actor, :active_fedora do
before do
# Don't test characterization on these items; it breaks TravisCI and it's slow
allow(CharacterizeJob).to receive(:perform_later)
allow(Hyrax::CurationConcern).to receive(:a... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/resource_sync/resource_list_writer_spec.rb | Ruby | apache-2.0 | 197 | main | 1,459 | # frozen_string_literal: true
# NOTE: This uses methods, such as `#delegated_attributes`, that inherit from ActiveFedora::Relation.
RSpec.describe Hyrax::ResourceSync::ResourceListWriter, :active_fedora, :clean_repo do
subject(:writer) do
described_class.new(resource_host: 'example.com', capability_list_url: cap... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/resource_sync/source_description_writer_spec.rb | Ruby | apache-2.0 | 197 | main | 850 | # frozen_string_literal: true
RSpec.describe Hyrax::ResourceSync::SourceDescriptionWriter do
let(:sitemap) { 'http://www.sitemaps.org/schemas/sitemap/0.9' }
let(:rs) { 'http://www.openarchives.org/rs/terms/' }
let(:capability_list) { 'http://example.com/capabilityList.xml' }
let(:xml) { Nokogiri::XML.parse(subj... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/resource_sync/change_list_writer_spec.rb | Ruby | apache-2.0 | 197 | main | 3,124 | # frozen_string_literal: true
# NOTE: This has been marked ActiveFedora only because the queries the class utilizes relies only on
# AF methods (for example, `lib/hyrax/resource_sync/change_list_writer.rb#L39`). If this fuctionality
# is missing in Valkyrie, this class will have to be reworked to include Valkyrie ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/resource_sync/capability_list_writer_spec.rb | Ruby | apache-2.0 | 197 | main | 1,490 | # frozen_string_literal: true
RSpec.describe Hyrax::ResourceSync::CapabilityListWriter do
let(:sitemap) { 'http://www.sitemaps.org/schemas/sitemap/0.9' }
let(:rs) { 'http://www.openarchives.org/rs/terms/' }
let(:resource_list) { 'http://example.com/resourcelist.xml' }
let(:change_list) { 'http://example.com/ch... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/rubocop/custom_cops_spec.rb | Ruby | apache-2.0 | 197 | main | 619 | # frozen_string_literal: true
require 'hyrax/rubocop/custom_cops'
RSpec.describe Hyrax::RuboCop::CustomCops::ArResource do
subject(:cop) { described_class.new }
it 'is not allowed to include Hyrax::ArResource' do
expect_offense(<<~RUBY)
include Hyrax::ArResource
^^^^^^^^^^^^^^^^^^^^^^^^^ Do not `i... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/controlled_vocabulary/importer/downloader_spec.rb | Ruby | apache-2.0 | 197 | main | 1,105 | # frozen_string_literal: true
require 'hyrax/controlled_vocabulary/importer/downloader'
RSpec.describe Hyrax::ControlledVocabulary::Importer::Downloader do
describe '.fetch' do
let(:url) { 'http://example.org/' }
let(:output) { double('output') }
context 'when connection is successful' do
let(:io)... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/hyrax/controlled_vocabulary/importer/language_spec.rb | Ruby | apache-2.0 | 197 | main | 718 | # frozen_string_literal: true
require 'hyrax/controlled_vocabulary/importer/language'
RSpec.describe Hyrax::ControlledVocabulary::Importer::Language do
before do
allow(Hyrax.logger).to receive(:extend)
allow(Hyrax::ControlledVocabulary::Importer::Downloader).to receive(:fetch)
allow(instance).to receive(... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/freyja/metadata_adapter_spec.rb | Ruby | apache-2.0 | 197 | main | 331 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'freyja/metadata_adapter'
RSpec.describe Freyja::MetadataAdapter, :active_fedora do
let(:adapter) { described_class.new }
it_behaves_like "a Valkyrie::MetadataAd... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/freyja/persister_spec.rb | Ruby | apache-2.0 | 197 | main | 21,152 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'freyja/metadata_adapter'
RSpec.describe Freyja::Persister, :active_fedora, :clean_repo, valkyrie_adapter: :freyja_adapter do
subject(:persister) { described_class.... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/freyja/query_service_spec.rb | Ruby | apache-2.0 | 197 | main | 2,210 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'freyja/metadata_adapter'
RSpec.describe Freyja::QueryService, :clean_repo do
let(:adapter) { Freyja::MetadataAdapter.new }
context "items in postgres only" do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/freyja/resource_factory_spec.rb | Ruby | apache-2.0 | 197 | main | 610 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'wings'
require 'freyja/metadata_adapter'
RSpec.describe Freyja::ResourceFactory, :active_fedora do
subject(:factory) { described_class.new(adapter: adapter) }
let(:adapter) { Freyja::MetadataAdapter.new }
let(... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/frigg/metadata_adapter_spec.rb | Ruby | apache-2.0 | 197 | main | 329 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'frigg/metadata_adapter'
RSpec.describe Frigg::MetadataAdapter, :active_fedora do
let(:adapter) { described_class.new }
it_behaves_like "a Valkyrie::MetadataAdap... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/frigg/query_service_spec.rb | Ruby | apache-2.0 | 197 | main | 1,970 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'frigg/metadata_adapter'
RSpec.describe Frigg::QueryService, :clean_repo do
let(:adapter) { Frigg::MetadataAdapter.new }
xcontext "items in postgres only" do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/lib/frigg/persister_spec.rb | Ruby | apache-2.0 | 197 | main | 21,051 | # frozen_string_literal: true
return if Hyrax.config.disable_wings
require 'spec_helper'
require 'valkyrie/specs/shared_specs'
require 'wings'
require 'frigg/metadata_adapter'
RSpec.describe Frigg::Persister, :active_fedora do
subject(:persister) { described_class.new(adapter: adapter) }
let(:adapter) { Frigg::M... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/resource_name_spec.rb | Ruby | apache-2.0 | 197 | main | 901 | # frozen_string_literal: true
RSpec.describe Hyrax::ResourceName do
subject(:name) { described_class.new(work_class) }
let(:work_class) { Monograph }
it 'has a namespaced route key' do
expect(name.route_key).to start_with 'hyrax_'
end
it 'has a namespaced singular route key' do
expect(name.singular... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/publisher_spec.rb | Ruby | apache-2.0 | 197 | main | 521 | # frozen_string_literal: true
RSpec.describe Hyrax::Publisher do
subject(:publisher) { described_class.instance } # singleton instance
describe "#default_listeners" do
it "returns a collection of listeners" do
# listeners can be any Object, so we can't verify they are valid here
expect(publisher.d... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/indexer_spec.rb | Ruby | apache-2.0 | 197 | main | 661 | # frozen_string_literal: true
require 'hyrax/specs/shared_specs'
RSpec.describe Hyrax::Indexer do
subject(:indexer) { indexer_class.new(resource: work) }
let(:work) { FactoryBot.build(:hyrax_work) }
let(:indexer_class) do
Class.new(Hyrax::ValkyrieIndexer) do
include Hyrax::Indexer(:core_metada... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/valkyrie_can_can_adapter_spec.rb | Ruby | apache-2.0 | 197 | main | 1,375 | # frozen_string_literal: true
RSpec.describe Hyrax::ValkyrieCanCanAdapter do
describe '.find' do
let(:work) { FactoryBot.valkyrie_create(:hyrax_work) }
it 'raises an ObjectNotFoundError' do
expect { described_class.find(work.class, 'MISSING_ID') }
.to raise_error Hyrax::ObjectNotFoundError
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/schema_spec.rb | Ruby | apache-2.0 | 197 | main | 3,952 | # frozen_string_literal: true
RSpec.describe Hyrax::Schema do
let(:attributes) { {} }
let(:resource) { resource_class.new(attributes) }
let(:resource_class) do
module HyraxSchemaSpecTest
module Schema
class Resource < Hyrax::Resource; end
end
end
HyraxSchemaSpecTest::Schema::R... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/controlled_vocabularies/location_spec.rb | Ruby | apache-2.0 | 197 | main | 633 | # frozen_string_literal: true
RSpec.describe Hyrax::ControlledVocabularies::Location do
let(:rdf_subject) { 'https://sws.geonames.org/5037649/' }
let(:location) { described_class.new(rdf_subject) }
before do
stub_request(:get, 'http://www.geonames.org/getJSON')
.with(query: hash_including({ 'geonameId'... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/health_checks/solr_check_spec.rb | Ruby | apache-2.0 | 197 | main | 650 | # frozen_string_literal: true
require 'hyrax/health_checks/solr_check'
RSpec.describe Hyrax::HealthChecks::SolrCheck do
subject(:check) { described_class.new }
it 'connects to solr' do
expect { check.check }
.not_to change { check.failure_occurred }
end
context 'with a broken solr service' do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/work_destroy_spec.rb | Ruby | apache-2.0 | 197 | main | 2,469 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::WorkDestroy do
subject(:transaction) { described_class.new }
let(:work) { FactoryBot.valkyrie_create(:hyrax_work, read_users: [user], members: [file_set]) }
let(:file_set) { FactoryBot.valky... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/file_set_update_spec.rb | Ruby | apache-2.0 | 197 | main | 858 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::FileSetUpdate do
subject(:tx) { described_class.new }
let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set, title: 'image.jpg', creator: ['test_creator']) }
let(:change_set) { Hyrax::... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/transaction_spec.rb | Ruby | apache-2.0 | 197 | main | 1,766 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::Transaction do
subject(:tx) { described_class.new(steps: step_names) }
let(:step_names) { ['change_set.validate', 'change_set.apply'] }
let(:value) { :moomin }
let(... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/apply_change_set_spec.rb | Ruby | apache-2.0 | 197 | main | 2,517 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'hyrax/specs/spy_listener'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::ApplyChangeSet do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { bu... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/admin_set_create_spec.rb | Ruby | apache-2.0 | 197 | main | 2,273 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::AdminSetCreate, :clean_repo do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { FactoryBot.build(:hyrax_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/collection_create_spec.rb | Ruby | apache-2.0 | 197 | main | 3,626 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::CollectionCreate, :clean_repo do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { Hyrax::PcdmCollection.... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/collection_update_spec.rb | Ruby | apache-2.0 | 197 | main | 477 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::CollectionUpdate, valkyrie_adapter: :test_adapter do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { Facto... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/collection_destroy_spec.rb | Ruby | apache-2.0 | 197 | main | 1,644 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::CollectionDestroy, valkyrie_adapter: :test_adapter do
let(:resource) { FactoryBot.valkyrie_create(:hyrax_collection) }
let(:user) { FactoryBot.create(:user) }
subject(:tx) do
described_cl... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/admin_set_update_spec.rb | Ruby | apache-2.0 | 197 | main | 824 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::AdminSetUpdate do
subject(:tx) { described_class.new }
let(:admin_set) { FactoryBot.valkyrie_create(:hyrax_admin_set) }
let(:change_set) { Hyrax::Forms::AdministrativeSetForm.new(admin_set) }... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/file_set_destroy_spec.rb | Ruby | apache-2.0 | 197 | main | 2,237 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::FileSetDestroy do
subject(:transaction) { described_class.new }
let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set) }
describe '#call' do
let(:user) { FactoryBot.create(:user)... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/work_create_spec.rb | Ruby | apache-2.0 | 197 | main | 2,464 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::WorkCreate, :clean_repo do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { build(:hyrax_work) }
let(:... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/work_update_spec.rb | Ruby | apache-2.0 | 197 | main | 1,146 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'dry/container/stub'
RSpec.describe Hyrax::Transactions::WorkUpdate, valkyrie_adapter: :test_adapter do
subject(:tx) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:xmas) { DateTime... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/admin_set_destroy_spec.rb | Ruby | apache-2.0 | 197 | main | 2,009 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::AdminSetDestroy, valkyrie_adapter: :test_adapter do
subject(:tx) { described_class.new }
let(:resource) { FactoryBot.valkyrie_create(:hyrax_admin_set) }
describe '#call' do
it 'is a success' ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/set_default_admin_set_spec.rb | Ruby | apache-2.0 | 197 | main | 1,949 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::SetDefaultAdminSet do
subject(:step) { described_class.new }
let(:work) { build(:hyrax_work) }
let(:change_set) { Hyrax::ChangeSet.for(work) }
describe '#call' do
let(:admin_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/add_file_sets_spec.rb | Ruby | apache-2.0 | 197 | main | 712 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::AddFileSets, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:work) { FactoryBot.valkyrie_create(:hyrax_work) }
it 'gives success' do
expect(step.call... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/ensure_admin_set_spec.rb | Ruby | apache-2.0 | 197 | main | 664 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::EnsureAdminSet do
subject(:step) { described_class.new }
let(:work) { build(:hyrax_work) }
describe '#call' do
context 'without an admin set' do
it 'is a failure' do
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/update_work_members_spec.rb | Ruby | apache-2.0 | 197 | main | 1,995 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'hyrax/specs/spy_listener'
RSpec.describe Hyrax::Transactions::Steps::UpdateWorkMembers, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:listener) { Hyrax::Specs::SpyListener.new }
let(:work) ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/add_to_parent_spec.rb | Ruby | apache-2.0 | 197 | main | 1,413 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
require 'hyrax/specs/spy_listener'
RSpec.describe Hyrax::Transactions::Steps::AddToParent, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:listener) { Hyrax::Specs::SpyListener.new }
let(:work) { F... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/remove_file_set_from_work_spec.rb | Ruby | apache-2.0 | 197 | main | 2,593 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions/steps/add_to_collections'
require 'hyrax/specs/spy_listener'
RSpec.describe Hyrax::Transactions::Steps::RemoveFileSetFromWork, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:file_set) { FactoryBot.build(... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/delete_all_file_sets_spec.rb | Ruby | apache-2.0 | 197 | main | 1,023 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::DeleteAllFileSets, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:user) { FactoryBot.create(:user) }
let(:work) { FactoryBot.valkyrie_create(:hyrax... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/set_user_as_depositor_spec.rb | Ruby | apache-2.0 | 197 | main | 1,576 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions/steps/set_user_as_depositor'
RSpec.describe Hyrax::Transactions::Steps::SetUserAsDepositor do
subject(:step) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) { FactoryBot.build(:hyrax_wor... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/set_collection_type_gid_spec.rb | Ruby | apache-2.0 | 197 | main | 1,734 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::SetCollectionTypeGid do
subject(:step) { described_class.new }
let(:collection) { FactoryBot.build(:hyrax_collection, collection_type_gid: nil) }
let(:change_set) { Hyrax::ChangeSet.for(c... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/delete_all_file_metadata_spec.rb | Ruby | apache-2.0 | 197 | main | 909 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::DeleteAllFileMetadata, valkyrie_adapter: :test_adapter, storage_adapter: :test_disk do
subject(:step) { described_class.new }
let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set, :wit... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/delete_access_control_spec.rb | Ruby | apache-2.0 | 197 | main | 1,789 | # frozen_string_literal: true
require 'spec_helper'
require 'dry/monads'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::DeleteAccessControl, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
let(:work) { FactoryBot.valkyrie_create(:hyrax_work) }
context 'when... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/save_spec.rb | Ruby | apache-2.0 | 197 | main | 4,452 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions/steps/save'
require 'hyrax/specs/spy_listener'
RSpec.describe Hyrax::Transactions::Steps::Save do
subject(:step) { described_class.new(persister: persister) }
let(:adapter) { Hyrax.metadata_adapter }
let(:change_set) { ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/apply_permission_template_on_update_spec.rb | Ruby | apache-2.0 | 197 | main | 5,905 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::ApplyPermissionTemplateOnUpdate, valkyrie_adapter: :test_adapter do
subject(:step) { described_class.new }
context 'when admin set has not changed' do
let(:work) { FactoryBot.valkyrie_cr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/set_modified_date_spec.rb | Ruby | apache-2.0 | 197 | main | 1,362 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions'
RSpec.describe Hyrax::Transactions::Steps::SetModifiedDate do
subject(:step) { described_class.new }
let(:work) { build(:hyrax_work) }
let(:xmas) { DateTime.parse('2018-12-25 11:30') }
before { allow(Hyrax::TimeService).t... |
github | samvera/hyrax | https://github.com/samvera/hyrax | spec/hyrax/transactions/steps/add_to_collections_spec.rb | Ruby | apache-2.0 | 197 | main | 1,956 | # frozen_string_literal: true
require 'spec_helper'
require 'hyrax/transactions/steps/add_to_collections'
require 'hyrax/specs/spy_listener'
RSpec.describe Hyrax::Transactions::Steps::AddToCollections do
subject(:step) { described_class.new }
let(:change_set) { Hyrax::ChangeSet.for(resource) }
let(:resource) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.