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/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,485
# frozen_string_literal: true RSpec.describe 'hyrax/file_sets/media_display/_default.html.erb', type: :view do let(:ability) { double(Ability) } let(:file_set) { stub_model(FileSet, parent: parent) } let(:parent) { double } let(:link) { true } let(:work_solr_document) do SolrDocument.new(id: '900', title...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/file_sets/media_display/_audio.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,467
# frozen_string_literal: true RSpec.describe 'hyrax/file_sets/media_display/_audio.html.erb', type: :view do let(:ability) { double(Ability) } let(:file_set) { stub_model(FileSet, parent: parent) } let(:parent) { double } let(:link) { true } let(:work_solr_document) do SolrDocument.new(id: '900', title_t...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/file_sets/media_display/_video.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,467
# frozen_string_literal: true RSpec.describe 'hyrax/file_sets/media_display/_video.html.erb', type: :view do let(:ability) { double(Ability) } let(:file_set) { stub_model(FileSet, parent: parent) } let(:parent) { double } let(:link) { true } let(:work_solr_document) do SolrDocument.new(id: '900', title_t...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/embargoes/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
861
# frozen_string_literal: true RSpec.describe "hyrax/embargoes/index.html.erb", type: :view do before do stub_template 'hyrax/embargoes/_list_deactivated_embargoes' => 'rendered list_deactivated_embargoes' stub_template 'hyrax/embargoes/_list_expired_active_embargoes' => 'rendered list_expired_active_embargoes...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/_work_action_menu.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,587
# frozen_string_literal: true RSpec.describe 'hyrax/my/_work_action_menu.html.erb' do let(:id) { '123' } let(:document) { SolrDocument.new(id: id, has_model_ssim: 'GenericWork') } let(:user) { build(:user) } before do allow(view).to receive(:current_user).and_return(user) allow(view).to receive(:displa...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/facet.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,201
# frozen_string_literal: true # NOTE: this is a direct copy of the corresponding test in Blacklight # with changes for "views/my" instead of "views/catalog" RSpec.describe "hyrax/my/facet.html.erb", type: :view do let(:display_facet) { double } let(:blacklight_config) { Blacklight::Configuration.new } before d...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/_search_header.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,328
# frozen_string_literal: true RSpec.describe 'hyrax/my/_search_header.html.erb', type: :view do before do stub_template 'hyrax/my/_did_you_mean.html.erb' => '' stub_template 'hyrax/my/_sort_and_per_page.html.erb' => '' stub_template 'hyrax/my/_facets.html.erb' => '' stub_template 'catalog/_search_form...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/_collection_action_menu.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,659
# frozen_string_literal: true RSpec.describe 'hyrax/my/_collection_action_menu.html.erb' do let(:id) { '123' } let(:collection_doc) { SolrDocument.new(id: id, has_model_ssim: 'Collection') } let(:user) { build(:user) } let(:ability) { instance_double("Ability") } let(:collection_presenter) { Hyrax::Collection...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/collections/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,318
# frozen_string_literal: true RSpec.describe "hyrax/my/collections/index.html.erb", type: :view do let(:resp) { double(docs: "", total_count: 11) } before do assign(:managed_collection_count, 0) assign(:response, resp) allow(view).to receive(:can?).with(any_args).and_return(false) stub_template "...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/collections/_list_collections.html.erb_spec.rb
Ruby
apache-2.0
197
main
5,967
# frozen_string_literal: true RSpec.describe 'hyrax/my/collections/_list_collections.html.erb', type: :view do let(:id) { "3197z511f" } let(:modified_date) { DateTime.new(2014, 1, 1).iso8601 } def check_tr_data_attributes expect(rendered).to have_selector('tr[data-source="my"]') expect(rendered).to have...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/works/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,888
# frozen_string_literal: true RSpec.describe 'hyrax/my/works/index.html.erb', type: :view do let(:resp) { double(docs: "", total_count: 11) } let(:ability) { instance_double(Ability, can_create_any_work?: true, admin?: false) } let(:batch_enabled) { true } let(:presenter) { instance_double(Hyrax::SelectTypeList...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/my/works/_list_works.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,315
# frozen_string_literal: true RSpec.describe 'hyrax/my/works/_list_works.html.erb', type: :view do let(:id) { "3197z511f" } let(:work_data) do { id: id, "has_model_ssim" => ["GenericWork"], "title_tesim" => ["Work Title"] } end let(:doc) { SolrDocument.new(work_data) } let(:collecti...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/batch_edits/edit.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,110
# frozen_string_literal: true RSpec.describe 'hyrax/batch_edits/edit.html.erb', :clean_repo, type: :view do let(:generic_work) { valkyrie_create(:monograph, depositor: 'bob@example.com') } let(:batch) { ['999'] } let(:form) { Hyrax::Forms::ResourceBatchEditForm.new(generic_work, nil, batch) } before do all...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/batch_edits/check_all_spec.rb
Ruby
apache-2.0
197
main
466
# frozen_string_literal: true RSpec.describe 'hyrax/batch_edits/_check_all.html.erb', type: :view do before do allow(controller).to receive(:controller_name).and_return('my') view.lookup_context.prefixes.push 'hyrax/my' render end it 'renders actions for my items' do expect(rendered).to have_sel...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/features/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
491
# frozen_string_literal: true RSpec.describe "hyrax/admin/features/index.html.erb", type: :view do let(:ability) { instance_double("Ability") } let(:feature_set) do Flipflop::FeaturesController::FeaturesPresenter.new(Flipflop::FeatureSet.current) end before do allow(controller).to receive(:current_abil...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/stats/show.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,610
# frozen_string_literal: true RSpec.describe "hyrax/admin/stats/show.html.erb", type: :view do let(:presenter) do Hyrax::AdminStatsPresenter.new({}, 5) end before do assign(:presenter, presenter) allow(presenter).to receive(:top_formats).and_return([]) allow(presenter).to receive(:works_count).an...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/users/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,454
# frozen_string_literal: true RSpec.describe 'hyrax/admin/users/index.html.erb', type: :view do let(:presenter) { Hyrax::Admin::UsersPresenter.new } let(:users) { [] } before do (1..4).each { |i| users << build(:user, display_name: "user#{i}", email: "email#{i}@example.com", created_at: Time.zone.now - 3.day...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_form.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,623
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_form.html.erb', type: :view do let(:admin_set) { stub_model(AdminSet) } let(:form) { Hyrax::Forms::AdminSetForm.new(admin_set, double, double) } before do assign(:form, form) stub_template('hyrax/admin/admin_sets/_form_participants.htm...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,428
# frozen_string_literal: true require "spec_helper" RSpec.describe "hyrax/admin/admin_sets/index.html.erb", type: :view do before do allow(controller).to receive(:can?).with(:create, AdminSet).and_return(false) end context "when no admin sets exists" do it "alerts users there are no admin sets" do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/index.json.erb_spec.rb
Ruby
apache-2.0
197
main
1,136
# frozen_string_literal: true RSpec.describe "hyrax/admin/admin_sets/index.json.jbuilder" do context "when no admin sets exists" do it "renders no admin sets" do render json = JSON.parse(rendered) expect(json['admin_sets']).to eq [] end end context "when an admin set exists" do let(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_form_visibility.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,719
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_form_visibility.html.erb', type: :view do let(:template) { stub_model(Hyrax::PermissionTemplate) } let(:pt_form) { Hyrax::Forms::PermissionTemplateForm.new(template) } before do @form = instance_double(Hyrax::Forms::AdminSetForm, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_form_participants.html.erb_spec.rb
Ruby
apache-2.0
197
main
760
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_form_participants.html.erb', type: :view do let(:template) { stub_model(Hyrax::PermissionTemplate) } let(:pt_form) do instance_double(Hyrax::Forms::PermissionTemplateForm, model_name: template.model_name, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,331
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_show_document_list_row.html.erb', type: :view do let(:user) { create(:user, groups: 'admin') } let(:ability) { Ability.new(user) } let(:work) do stub_model(GenericWork, title: ['One Hundred Years of Solitude']) end before do view....
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
Ruby
apache-2.0
197
main
473
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_show_document_list.html.erb', type: :view do let(:documents) { ["Hello", "World"] } before do stub_template('hyrax/admin/admin_sets/_show_document_list_row.html.erb' => "<%= show_document_list_row %>") end it "renders rows of works" do...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/show.html.erb_spec.rb
Ruby
apache-2.0
197
main
956
# frozen_string_literal: true RSpec.describe "hyrax/admin/admin_sets/show.html.erb", type: :view do let(:solr_document) { SolrDocument.new } let(:ability) { instance_double("Ability") } let(:presenter) { Hyrax::AdminSetPresenter.new(solr_document, ability) } before do stub_template 'hyrax/admin/admin_sets/...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_form_participant_table.html.erb_spec.rb
Ruby
apache-2.0
197
main
5,315
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_form_participant_table.html.erb', type: :view do let(:template) { stub_model(Hyrax::PermissionTemplate) } let(:admin) { create(:admin) } let(:user) { create(:user) } let(:access_grants) { [stub_model(Hyrax::PermissionTemplateAccess)] } let(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_show_actions.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,625
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_show_actions.html.erb', type: :view do let(:solr_document) { SolrDocument.new } let(:ability) { instance_double("Ability") } let(:presenter) { Hyrax::AdminSetPresenter.new(solr_document, ability) } before do allow(controller).to receive(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/admin_sets/_form_workflow.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,078
# frozen_string_literal: true RSpec.describe 'hyrax/admin/admin_sets/_form_workflow.html.erb', type: :view do let(:template) { stub_model(Hyrax::PermissionTemplate) } let(:workflow) { stub_model(Sipity::Workflow, name: "my_name", description: "random workflow", label: "my label") } let(:pt_form) do instance_d...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_settings.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,846
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_settings.html.erb', type: :view do # TODO: add fields as they become available: # collection_type_assigns_workflow # collection_type_require_membership # collection_type_assigns_visibility INPUT_IDS = %w[ collection_type_nes...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_appearance.html.erb_spec.rb
Ruby
apache-2.0
197
main
747
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_appearance.html.erb', type: :view do let(:collection_type) { create(:collection_type) } let(:collection_type_form) { Hyrax::Forms::Admin::CollectionTypeForm.new } let(:form) do view.simple_form_for(collection_type, url: '/update...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_metadata_admin_set.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,009
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_metadata_admin_set.html.erb', type: :view do let(:collection_type) { stub_model(Hyrax::CollectionType) } let(:collection_type_form) { Hyrax::Forms::Admin::CollectionTypeForm.new } let(:form) do view.simple_form_for(collection_ty...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_participants.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,097
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_participants.html.erb', type: :view do let(:collection_type) { build(:collection_type) } let(:form) { Hyrax::Forms::Admin::CollectionTypeForm.new(collection_type: collection_type) } let(:collection_type_participant) { build(:collecti...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_participants_table.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,701
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_participant_table.html.erb', type: :view do let(:user) { create(:user) } let(:collection_type) { stub_model(Hyrax::CollectionType) } let(:collection_type_participant) { stub_model(Hyrax::CollectionTypeParticipant) } let(:form) do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form_metadata.html.erb_spec.rb
Ruby
apache-2.0
197
main
982
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form_metadata.html.erb', type: :view do let(:collection_type) { create(:collection_type) } let(:collection_type_form) { Hyrax::Forms::Admin::CollectionTypeForm.new } let(:form) do view.simple_form_for(collection_type, url: '/update')...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,946
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'hyrax/admin/collection_types/index.html.erb', type: :view do let(:user_collection_type) do stub_model(Hyrax::CollectionType, collections: [], title: 'User Collection') end let(:admin_set_collection_type) do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/collection_types/_form.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,763
# frozen_string_literal: true RSpec.describe 'hyrax/admin/collection_types/_form.html.erb', type: :view do let(:collection_type) { build(:collection_type) } let(:form) { Hyrax::Forms::Admin::CollectionTypeForm.new(collection_type: collection_type) } before do assign(:form, form) assign(:collection_type, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/admin/workflow_roles/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,240
# frozen_string_literal: true RSpec.describe 'hyrax/admin/workflow_roles/index.html.erb', type: :view do let!(:user1) { build(:user) } let!(:user2) { build(:user) } let(:agent_presenter) do instance_double(Hyrax::Admin::WorkflowRolesPresenter::AgentPresenter, responsibilities_present?: res...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/leases/index.html.erb_spec.rb
Ruby
apache-2.0
197
main
807
# frozen_string_literal: true RSpec.describe "hyrax/leases/index", type: :view do before do stub_template 'hyrax/leases/_list_deactivated_leases' => 'rendered list_deactivated_leases' stub_template 'hyrax/leases/_list_expired_active_leases' => 'rendered list_expired_active_leases' stub_template 'hyrax/lea...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/uploads/create.json.jbuilder_spec.rb
Ruby
apache-2.0
197
main
604
# frozen_string_literal: true RSpec.describe 'hyrax/uploads/create.json.jbuilder' do let(:file) { double(filename: 'foo.jpg', size: 777) } let(:uploader) { instance_double(Hyrax::UploadedFileUploader, file: file) } let(:upload) { mock_model(Hyrax::UploadedFile, file: uploader) } before do assign(:upload, u...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/single_use_links_viewer/show.html.erb_spec.rb
Ruby
apache-2.0
197
main
797
# frozen_string_literal: true RSpec.describe 'hyrax/single_use_links_viewer/show.html.erb' do let(:solr_document) { SolrDocument.new(has_model_ssim: ['Hyrax::FileSet']) } let(:ability) { double } let(:hash) { "some-dummy-sha2-hash" } before do assign :download_link, Hyrax::Engine.routes.url_helpers.downlo...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/single_use_links_viewer/single_use_error.html.erb_spec.rb
Ruby
apache-2.0
197
main
234
# frozen_string_literal: true RSpec.describe 'hyrax/single_use_links_viewer/single_use_error.html.erb' do it 'renders without errors' do render expect(rendered).to have_text("Single Use Link Expired or Not Found") end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/hyrax/stats/file.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,369
# frozen_string_literal: true RSpec.describe 'hyrax/stats/file.html.erb', type: :view do describe 'usage statistics' do before do allow_message_expectations_on_nil end let(:no_stats) do double('FileUsage', created: Date.parse('2014-01-01'), total_pageviews: 0, ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/records/edit_fields/_language.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,545
# frozen_string_literal: true RSpec.describe 'records/edit_fields/_language.html.erb', type: :view do RSpec.shared_examples 'check for language autocomplete url' do it 'has url for autocomplete service' do expect(rendered).to have_selector('input[data-autocomplete-url="/authorities/search/local/languages"][...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/records/edit_fields/_based_near.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,511
# frozen_string_literal: true RSpec.describe 'records/edit_fields/_based_near.html.erb', type: :view do RSpec.shared_examples 'check for based_near autocomplete url' do it 'has url for autocomplete service' do expect(rendered).to have_selector('input[data-autocomplete-url="/authorities/search/geonames"][dat...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/records/edit_fields/_subject.html.erb_spec.rb
Ruby
apache-2.0
197
main
1,436
# frozen_string_literal: true RSpec.describe 'records/edit_fields/_subject.html.erb', type: :view do RSpec.shared_examples 'check for subject autocomplete url' do it 'has url for autocomplete service' do expect(rendered).to have_selector('input[data-autocomplete-url="/authorities/search/local/subjects"][dat...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/records/edit_fields/_description.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,764
# frozen_string_literal: true RSpec.describe 'records/edit_fields/_description.html.erb', type: :view do RSpec.shared_examples 'description field behaviors' do context "when single valued" do before do expect(form).to receive(:multiple?).and_return(false) end context "when not required"...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/content_blocks/edit.html.erb_spec.rb
Ruby
apache-2.0
197
main
894
# frozen_string_literal: true RSpec.describe "hyrax/content_blocks/edit", type: :view do before { render } it "renders the announcement form" do assert_select "form[action=?][method=?]", hyrax.content_block_path(ContentBlock.for(:announcement)), "post" do assert_select "textarea#content_block_announcemen...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/catalog/_index_list_default.html.erb_spec.rb
Ruby
apache-2.0
197
main
2,043
# frozen_string_literal: true RSpec.describe 'catalog/_index_list_default', type: :view do let(:attributes) do { 'creator_tesim' => ['Test creator_tesim'], 'depositor_tesim' => ['Test depositor_tesim'], 'proxy_depositor_ssim' => ['Test proxy_depositor_ssim'], 'description_tesim' => ['Test descri...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/catalog/_search_form.html.erb_spec.rb
Ruby
apache-2.0
197
main
662
# frozen_string_literal: true RSpec.describe 'catalog/_search_form.html.erb', type: :view do before do allow(view).to receive(:search_form_action).and_return("/catalog") allow(view).to receive(:search_state).and_return(search_state) allow(view).to receive(:current_search_parameters).and_return(nil) al...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/shared/select_work_type_modal.html.erb_spec.rb
Ruby
apache-2.0
197
main
3,421
# frozen_string_literal: true require 'rails_helper' include Warden::Test::Helpers RSpec.describe 'shared/_select_work_type_modal.html.erb', type: :view do include(Devise::Test::ControllerHelpers) let(:presenter) { instance_double Hyrax::SelectTypeListPresenter } let(:row1) { Hyrax::SelectTypePresenter.new(Gener...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/views/shared/_citations.html.erb_spec.rb
Ruby
apache-2.0
197
main
7,801
# frozen_string_literal: true RSpec.describe 'shared/_citations.html.erb', type: :view do let(:work_solr_document) do SolrDocument.new(id: '999', title_tesim: ['My Title'], creator_tesim: ['Doe, John', 'Doe, Jane'], date_modified_dtsi: '2011-04-01', ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/pcdm_collection_indexer_spec.rb
Ruby
apache-2.0
197
main
252
# frozen_string_literal: true RSpec.describe Hyrax::PcdmCollectionIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::PcdmCollectionIndexer/) described_class.new(resource: Hyrax::PcdmCollection.new) end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/administrative_set_indexer_spec.rb
Ruby
apache-2.0
197
main
319
# frozen_string_literal: true RSpec.describe Hyrax::AdministrativeSetIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::AdministrativeSetIndexer/) expect(described_class.new(resource: Hyrax::AdministrativeSet.new)).to be_a Hyrax::Indexers::AdministrativeSetIndexer end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/file_set_indexer_spec.rb
Ruby
apache-2.0
197
main
6,067
# frozen_string_literal: true # Marked as AF-only, since Valkyrie FileSet indexing is handled by Hyrax::ValkyrieFileSetIndexer. RSpec.describe Hyrax::FileSetIndexer, :active_fedora do include Hyrax::FactoryHelpers let(:file_set) do FileSet.new( id: 'foo12345', contributor: ['Mohammad'], crea...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/admin_set_indexer_spec.rb
Ruby
apache-2.0
197
main
1,356
# frozen_string_literal: true RSpec.describe Hyrax::AdminSetIndexer do let(:indexer) { described_class.new(admin_set) } let(:admin_set) { build(:complete_admin_set) } let(:doc) do { 'generic_type_sim' => ['Admin Set'] } end describe "#generate_solr_document" do it "has required fields" do ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/valkyrie_collection_indexer_spec.rb
Ruby
apache-2.0
197
main
394
# frozen_string_literal: true RSpec.describe Hyrax::ValkyrieCollectionIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::ValkyrieCollectionIndexer/) expect(Deprecation).to receive(:warn).with(/Hyrax::PcdmCollectionIndexer/) expect(described_class.new(resource: Hyrax::Pcdm...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/valkyrie_work_indexer_spec.rb
Ruby
apache-2.0
197
main
289
# frozen_string_literal: true RSpec.describe Hyrax::ValkyrieWorkIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::ValkyrieWorkIndexer/) expect(described_class.new(resource: Hyrax::Work.new)).to be_a Hyrax::Indexers::PcdmObjectIndexer end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/collection_indexer_spec.rb
Ruby
apache-2.0
197
main
1,568
# frozen_string_literal: true # Marked as AF-only, since Valkyrie Collection indexing is handled by Hyrax::PcdmCollectionIndexer. RSpec.describe Hyrax::CollectionIndexer, :active_fedora do let(:indexer) { described_class.new(collection) } let(:collection) { build(:collection_lw) } let(:col1id) { 'col1' } let(:...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/valkyrie_file_set_indexer_spec.rb
Ruby
apache-2.0
197
main
295
# frozen_string_literal: true RSpec.describe Hyrax::ValkyrieFileSetIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::ValkyrieFileSetIndexer/) expect(described_class.new(resource: Hyrax::FileSet.new)).to be_a Hyrax::Indexers::FileSetIndexer end end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/valkyrie_indexer_spec.rb
Ruby
apache-2.0
197
main
531
# frozen_string_literal: true RSpec.describe Hyrax::ValkyrieIndexer do it "is deprecated" do expect(Deprecation).to receive(:warn).with(/Hyrax::ValkyrieIndexer/) expect(described_class.new(resource: Hyrax::Resource.new)).to be_a Hyrax::Indexers::ResourceIndexer end describe ".for" do it "is deprecat...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/deep_indexing_service_spec.rb
Ruby
apache-2.0
197
main
1,602
# frozen_string_literal: true # Marked as AF-only, since Valkyrie work indexing is handled by Hyrax::ValkyrieWorkIndexer. RSpec.describe Hyrax::DeepIndexingService, :active_fedora do subject(:service) { described_class.new(work) } let(:work) { FactoryBot.build(:work) } before do newberg = <<RDFXML.strip_her...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/generic_work_indexer_spec.rb
Ruby
apache-2.0
197
main
5,447
# frozen_string_literal: true RSpec.describe GenericWorkIndexer, :active_fedora do subject(:solr_document) { service.generate_solr_document } # TODO: file_set_ids returns an empty set unless you persist the work let(:user) { create(:user) } let(:service) { described_class.new(work) } let(:work) { create(:gen...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/indexers/resource_indexer_spec.rb
Ruby
apache-2.0
197
main
2,573
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Indexers::ResourceIndexer do let(:indexer_class) { described_class } let(:resource) { FactoryBot.build(:hyrax_work) } let(:indexer) { described_class.new(resource: resource) } it_behaves_like 'a Hyrax::Resource indexer' ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/indexers/administrative_set_indexer_spec.rb
Ruby
apache-2.0
197
main
639
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Indexers::AdministrativeSetIndexer do let(:resource) { FactoryBot.valkyrie_create(:hyrax_admin_set) } let(:indexer_class) { described_class } it_behaves_like 'an Administrative Set indexer' subject(:service) { described_c...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/indexers/pcdm_collection_indexer_spec.rb
Ruby
apache-2.0
197
main
302
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Indexers::PcdmCollectionIndexer do let(:resource) { FactoryBot.valkyrie_create(:hyrax_collection, :as_collection_member) } let(:indexer_class) { described_class } it_behaves_like 'a Collection indexer' end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/indexers/file_set_indexer_spec.rb
Ruby
apache-2.0
197
main
13,904
# frozen_string_literal: true RSpec.describe Hyrax::Indexers::FileSetIndexer, :frozen_time, if: Hyrax.config.use_valkyrie? do include Hyrax::FactoryHelpers let(:fileset_id) { 'fs1' } let(:file_set) do Hyrax::FileSet.new( id: fileset_id, file_ids: [mock_file.id, mock_text.id, mock_thumbnail.id], ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/hyrax/indexers/pcdm_object_indexer_spec.rb
Ruby
apache-2.0
197
main
5,119
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Indexers::PcdmObjectIndexer do let(:resource) { FactoryBot.valkyrie_create(:hyrax_work) } let(:indexer_class) do Class.new(described_class) do include Hyrax::Indexer(:core_metadata) end end it_behaves_like 'a...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/concerns/hyrax/visibility_indexer_spec.rb
Ruby
apache-2.0
197
main
316
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::VisibilityIndexer do let(:indexer_class) do Class.new(Hyrax::ValkyrieIndexer) do include Hyrax::VisibilityIndexer end end let(:resource) { Hyrax::Resource.new } it_behaves_like 'a visibility indexer' end
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/indexers/concerns/hyrax/permission_indexer_spec.rb
Ruby
apache-2.0
197
main
340
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::PermissionIndexer do let(:indexer_class) do Class.new(Hyrax::ValkyrieIndexer) do include Hyrax::PermissionIndexer end end let(:resource) { FactoryBot.valkyrie_create(:hyrax_resource) } it_behaves_like 'a perm...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/generic_work_abilities_spec.rb
Ruby
apache-2.0
197
main
1,989
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability, :active_fedora do subject { Ability.new(current_user) } let(:generic_work) { create(:private_generic_work, user: creating_user) } let(:user) { create(:user) } describe 'without embargo' do describe 'creator of object' ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/proxies_and_transfer_abilities_spec.rb
Ruby
apache-2.0
197
main
4,956
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject(:ability) { Ability.new(user) } let(:user) { create(:user) } describe "Transfers" do before do allow(Flipflop).to receive(:transfer_works?).and_return(transfer_enabled) allow(ability).to receive(:use...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/admin_ability_spec.rb
Ruby
apache-2.0
197
main
454
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do context "with a registered user" do let(:user) { create(:user) } subject { Ability.new(user) } it { is_expected.not_to be_able_to(:read, :admin_dashboard) } end context "with an administrative user" do let(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/collection_type_ability_spec.rb
Ruby
apache-2.0
197
main
2,935
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject { ability } let(:ability) { Ability.new(current_user) } let(:user) { create(:user) } let(:current_user) { user } context 'when admin user' do let(:user) { FactoryBot.create(:admin) } let(:collection_typ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/admin_set_ability_spec.rb
Ruby
apache-2.0
197
main
20,797
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability, :clean_repo do subject(:ability) { Ability.new(current_user) } let(:admin) { FactoryBot.create(:admin, email: 'admin@example.com') } let(:user) { FactoryBot.create(:user, email: 'user@example.com') } let(:current_user) { use...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/permission_template_ability_spec.rb
Ruby
apache-2.0
197
main
5,678
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject(:ability) { Ability.new(current_user) } let(:user) { create(:user) } let(:current_user) { user } let(:collection_type) { FactoryBot.create(:collection_type) } let!(:collection) { valkyrie_create(:hyrax_collection...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/ability_spec.rb
Ruby
apache-2.0
197
main
6,493
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject(:ability) { Ability.new(user) } describe '.admin_group_name' do let(:user) { create(:user) } it 'returns the admin group name' do expect(subject.admin_group_name).to eq 'admin' end end describe...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/embargo_and_lease_ability_spec.rb
Ruby
apache-2.0
197
main
650
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject { Ability.new(current_user) } let(:current_user) { create(:user) } describe "a regular user" do it do is_expected.not_to be_able_to :index, Hydra::AccessControls::Embargo is_expected.not_to be_able_...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/operation_ability_spec.rb
Ruby
apache-2.0
197
main
345
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do describe "a registered user" do subject { Ability.new(user) } let(:user) { create(:user) } it { is_expected.to be_able_to(:read, build(:operation, user: user)) } it { is_expected.not_to be_able_to(:read, build(...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/collection_ability_spec.rb
Ruby
apache-2.0
197
main
21,112
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability, :clean_repo do subject { ability } let(:ability) { Ability.new(current_user) } let(:user) { FactoryBot.create(:user, email: 'user@example.com') } let(:current_user) { user } let(:collection_type) { FactoryBot.create(:coll...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/abilities/file_set_abilities_spec.rb
Ruby
apache-2.0
197
main
2,340
# frozen_string_literal: true require 'cancan/matchers' RSpec.describe Hyrax::Ability do subject(:ability) { Ability.new(current_user) } let(:visibility) { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE } let(:creating_user) { create(:user) } let(:user) { create(:user) } let(:current_user)...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/strategies/hyrax/strategies/yaml_strategy_spec.rb
Ruby
apache-2.0
197
main
876
# frozen_string_literal: true RSpec.describe Hyrax::Strategies::YamlStrategy do subject { described_class.new(config: tmpfile) } context "when given a YAML file" do let(:content) { { "assign_admin_set" => { "enabled" => false } }.to_yaml } let(:tmpfile) { Tempfile.new } before do tmpfile.write(c...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/generic_work_form_spec.rb
Ruby
apache-2.0
197
main
4,112
# frozen_string_literal: true return unless defined? Hyrax::GenericWorkForm # TODO: this should be merged with work_form_spec.rb RSpec.describe Hyrax::GenericWorkForm do let(:work) { GenericWork.new } let(:form) { described_class.new(work, nil, nil) } describe "#required_fields" do subject { form.required_...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/file_set_edit_form_spec.rb
Ruby
apache-2.0
197
main
2,242
# frozen_string_literal: true # This uses app/services/hydra_editor/field_metadata_service.rb, which calls # #reflect_on_association on the FileSet class. This is an ActiveFedora-specific # method that doesn't translate to Valkyrie Work behavior. RSpec.describe Hyrax::Forms::FileSetEditForm, :active_fedora do su...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/workflow_responsibility_form_spec.rb
Ruby
apache-2.0
197
main
1,489
# frozen_string_literal: true RSpec.describe Hyrax::Forms::WorkflowResponsibilityForm do let(:instance) { described_class.new } describe "#initialize" do let(:user) { create(:user) } let(:instance) { described_class.new(user_id: user.id, workflow_role_id: 7) } subject { instance.model_instance } ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/batch_edit_form_spec.rb
Ruby
apache-2.0
197
main
4,068
# frozen_string_literal: true # NOTE: Valkyrie has it's own form class (Hyrax::Forms::ResourceBatchEditForm). # This is the legacy ActiveFedora form. RSpec.describe Hyrax::Forms::BatchEditForm, :active_fedora do let(:model) { GenericWork.new } let(:work1) do create :generic_work, title: ["title 1"...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/resource_form_spec.rb
Ruby
apache-2.0
197
main
25,940
# frozen_string_literal: true require 'hyrax/specs/shared_specs' RSpec.describe Hyrax::Forms::ResourceForm do subject(:form) { described_class.for(work) } let(:work) { Hyrax::Work.new } let(:default_admin_set) { instance_double(Hyrax::AdministrativeSet, title: "DEFAULT_ADMINSET", id: "DEFAULT_ADMINSET_ID")...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/failed_submission_form_wrapper_spec.rb
Ruby
apache-2.0
197
main
4,240
# frozen_string_literal: true RSpec.describe Hyrax::Forms::FailedSubmissionFormWrapper do let(:form) { instance_double(Hyrax::Forms::WorkForm, **form_attributes) } let(:form_attributes) { { title: ["Form's Title"], description: ["Form's description"] } } # I would love to use Hyrax::Forms::WorkForm, but I encount...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/pcdm_collection_form_spec.rb
Ruby
apache-2.0
197
main
4,142
# frozen_string_literal: true RSpec.describe Hyrax::Forms::PcdmCollectionForm do let(:collection) { Hyrax::PcdmCollection.new(id: "123") } subject(:form) { described_class.new(collection) } describe '.required_fields' do it 'lists required fields' do if Hyrax.config.flexible? # In flexible m...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/resource_batch_edit_form_spec.rb
Ruby
apache-2.0
197
main
3,367
# frozen_string_literal: true RSpec.describe Hyrax::Forms::ResourceBatchEditForm do let(:model) { FactoryBot.build(:monograph) } let(:work1) do FactoryBot.valkyrie_create(:monograph, title: ["title 1"], keyword: ["abc"], creator: ["Wilma"], language: ['en'], ...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/admin_set_form_spec.rb
Ruby
apache-2.0
197
main
2,625
# frozen_string_literal: true RSpec.describe Hyrax::Forms::AdminSetForm, :active_fedora do let(:ability) { Ability.new(create(:user)) } let(:repository) { double } let(:form) { described_class.new(model, ability, repository) } describe "[] accessors" do let(:model) { build(:admin_set, description: ['one'])...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/file_set_form_spec.rb
Ruby
apache-2.0
197
main
2,860
# frozen_string_literal: true RSpec.describe Hyrax::Forms::FileSetForm do subject(:form) { described_class.new(file_set) } let(:file_set) { Hyrax::FileSet.new } describe '.fields' do # rubocop:disable RSpec/RepeatedDescription (these aren't repeated, rubocop) its(:fields) { is_expected.to have_key('base...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/workflow_action_form_spec.rb
Ruby
apache-2.0
197
main
4,766
# frozen_string_literal: true RSpec.describe Hyrax::Forms::WorkflowActionForm do subject(:form) do described_class.new(current_ability: Ability.new(user), work: work, attributes: { name: 'an_action', comment: 'a_comment' }) end let(:user) { FactoryBot.create(:u...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/collection_form_spec.rb
Ruby
apache-2.0
197
main
6,100
# frozen_string_literal: true RSpec.describe Hyrax::Forms::CollectionForm, skip: !(Hyrax.config.collection_class < ActiveFedora::Base) do let(:collection) { build(:collection_lw) } let(:ability) { Ability.new(create(:user)) } let(:repository) { double } let(:form) { described_class.new(collection, ability, repo...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/batch_upload_form_spec.rb
Ruby
apache-2.0
197
main
3,023
# frozen_string_literal: true # This uses app/services/hydra_editor/field_metadata_service.rb, which calls # #reflect_on_association on the Work class. This is an ActiveFedora-specific # method that doesn't translate to Valkyrie Work behavior. RSpec.describe Hyrax::Forms::BatchUploadForm, :active_fedora do let(:...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/administrative_set_form_spec.rb
Ruby
apache-2.0
197
main
3,275
# frozen_string_literal: true RSpec.describe Hyrax::Forms::AdministrativeSetForm do subject(:form) { described_class.new(admin_set) } let(:admin_set) { Hyrax::AdministrativeSet.new } describe '.required_fields' do it 'lists required fields' do if Hyrax.config.flexible? # In flexible mode, req...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/work_form_spec.rb
Ruby
apache-2.0
197
main
11,625
# frozen_string_literal: true RSpec.describe Hyrax::Forms::WorkForm, :active_fedora do let(:work) { GenericWork.new } let(:form) { described_class.new(work, nil, controller) } let(:works) { [GenericWork.new, FileSet.new, GenericWork.new] } let(:controller) { instance_double(Hyrax::GenericWorksController) } #...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/permission_template_form_spec.rb
Ruby
apache-2.0
197
main
23,318
# frozen_string_literal: true RSpec.describe Hyrax::Forms::PermissionTemplateForm do let(:permission_template) { build(:permission_template) } let(:form) { described_class.new(permission_template) } let(:today) { Time.zone.today } let(:admin_set) { valkyrie_create(:hyrax_admin_set) } subject { form } it {...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/dashboard/nest_collection_form_spec.rb
Ruby
apache-2.0
197
main
9,678
# frozen_string_literal: true RSpec.describe Hyrax::Forms::Dashboard::NestCollectionForm, type: :form do let(:context) { double('Context', current_user: user) } let(:user) { create(:user) } let(:persistence_service) do double(Hyrax::Collections::NestedCollectionPersistenceService, persist_neste...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/admin/appearance_spec.rb
Ruby
apache-2.0
197
main
1,262
# frozen_string_literal: true RSpec.describe Hyrax::Forms::Admin::Appearance do let(:form) { described_class.new(arguments) } describe "update!" do let(:block) { instance_double(ContentBlock) } before do allow(ContentBlock).to receive(:find_or_create_by).and_return(block) end context "when a...
github
samvera/hyrax
https://github.com/samvera/hyrax
spec/forms/hyrax/forms/admin/collection_type_form_spec.rb
Ruby
apache-2.0
197
main
3,786
# frozen_string_literal: true RSpec.describe Hyrax::Forms::Admin::CollectionTypeForm, :clean_repo do subject(:form) { described_class.new(collection_type: collection_type) } let(:collection_type) { FactoryBot.build(:collection_type) } shared_context 'with a collection' do let(:collection_type) { FactoryBot.c...