Sha256: c501053eb4d45ee5a8c336a3dcb5886d6d091bf68ec36738d19a4e70c033d96a
Contents?: true
Size: 1.22 KB
Versions: 21
Compression:
Stored size: 1.22 KB
Contents
# frozen_string_literal: true FactoryBot.define do factory :search, class: 'Spotlight::Search' do exhibit sequence(:title) { |n| "Exhibit Search #{n}" } sequence(:slug) { |n| "Search#{n}" } after(:build) { |search| search.thumbnail = FactoryBot.create(:featured_image) } factory :search_with_groups do transient do groups_count { 2 } end end after(:create) do |search, evaluator| create_list(:group, evaluator.groups_count, searches: [search]) if evaluator.respond_to?(:groups_count) end end factory :published_search, parent: :search do published { true } end factory :default_search, class: 'Spotlight::Search' do exhibit title { 'All exhibit items' } long_description { 'All items in this exhibit.' } after(:build) { |search| search.thumbnail = FactoryBot.create(:featured_image) } end factory :search_field_search, class: 'Spotlight::Search' do exhibit title { 'Based on a search field' } query_params { { 'search_field' => 'search', 'q' => 'model' } } end factory :facet_search, class: 'Spotlight::Search' do exhibit title { 'Based on a facet' } query_params { { 'f' => { 'language_ssim' => 'Latin' } } } end end
Version data entries
21 entries across 21 versions & 1 rubygems