enju_biblio 0.3.13 → 0.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/controllers/agents_controller.rb +6 -0
- data/app/controllers/content_types_controller.rb +1 -1
- data/app/controllers/items_controller.rb +10 -18
- data/app/controllers/manifestations_controller.rb +85 -80
- data/app/controllers/resource_import_results_controller.rb +2 -6
- data/app/controllers/series_statements_controller.rb +6 -0
- data/app/helpers/enju_biblio/application_helper.rb +5 -5
- data/app/helpers/manifestations_helper.rb +12 -12
- data/app/models/agent.rb +4 -13
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_relationship_type.rb +8 -7
- data/app/models/agent_type.rb +10 -7
- data/app/models/carrier_type.rb +14 -11
- data/app/models/content_type.rb +10 -7
- data/app/models/create_type.rb +8 -7
- data/app/models/doi_record.rb +36 -0
- data/app/models/form_of_work.rb +11 -8
- data/app/models/frequency.rb +11 -8
- data/app/models/identifier.rb +1 -1
- data/app/models/identifier_type.rb +1 -0
- data/app/models/import_request.rb +3 -4
- data/app/models/isbn_record.rb +51 -0
- data/app/models/isbn_record_and_manifestation.rb +18 -0
- data/app/models/issn_record.rb +49 -0
- data/app/models/issn_record_and_manifestation.rb +18 -0
- data/app/models/item.rb +7 -55
- data/app/models/language.rb +10 -9
- data/app/models/license.rb +9 -7
- data/app/models/manifestation.rb +271 -158
- data/app/models/manifestation_relationship_type.rb +9 -7
- data/app/models/medium_of_performance.rb +11 -8
- data/app/models/periodical.rb +33 -0
- data/app/models/periodical_and_manifestation.rb +16 -0
- data/app/models/picture_file.rb +2 -0
- data/app/models/produce_type.rb +8 -7
- data/app/models/realize_type.rb +8 -7
- data/app/models/resource_export_file.rb +8 -6
- data/app/models/resource_export_file_state_machine.rb +1 -1
- data/app/models/resource_import_file.rb +62 -153
- data/app/views/agent_import_results/index.txt.erb +3 -0
- data/app/views/agent_relationship_types/index.html.erb +1 -1
- data/app/views/agent_relationship_types/show.html.erb +1 -1
- data/app/views/agent_relationships/_form.html.erb +1 -1
- data/app/views/agent_types/index.html.erb +1 -1
- data/app/views/agent_types/show.html.erb +1 -1
- data/app/views/agents/_agent.html.erb +1 -1
- data/app/views/agents/_agent_list.html.erb +2 -2
- data/app/views/agents/_form.html.erb +4 -4
- data/app/views/agents/_index_agent.html.erb +1 -1
- data/app/views/agents/_index_agent_merge_list.html.erb +1 -1
- data/app/views/agents/_index_expression.html.erb +2 -2
- data/app/views/agents/_index_manifestation.html.erb +2 -2
- data/app/views/agents/_index_work.html.erb +2 -2
- data/app/views/agents/index.atom.builder +1 -1
- data/app/views/agents/index.rss.builder +3 -3
- data/app/views/agents/show.html+phone.erb +2 -2
- data/app/views/agents/show.html.erb +2 -2
- data/app/views/carrier_types/index.html.erb +2 -2
- data/app/views/carrier_types/show.html.erb +3 -3
- data/app/views/content_types/index.html.erb +1 -1
- data/app/views/content_types/show.html.erb +1 -1
- data/app/views/countries/index.html.erb +1 -1
- data/app/views/countries/show.html.erb +1 -1
- data/app/views/create_types/index.html.erb +1 -1
- data/app/views/create_types/show.html.erb +1 -1
- data/app/views/creates/_form.html.erb +1 -1
- data/app/views/form_of_works/index.html.erb +1 -1
- data/app/views/form_of_works/show.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +1 -1
- data/app/views/frequencies/show.html.erb +1 -1
- data/app/views/identifier_types/index.html.erb +1 -1
- data/app/views/identifier_types/show.html.erb +1 -1
- data/app/views/items/_form.html.erb +13 -33
- data/app/views/items/index.html+phone.erb +3 -3
- data/app/views/items/index.html.erb +3 -3
- data/app/views/items/show.html+phone.erb +5 -5
- data/app/views/items/show.html.erb +119 -134
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/languages/show.html.erb +1 -1
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/items.html.erb +1 -1
- data/app/views/layouts/manifestations.html.erb +4 -4
- data/app/views/licenses/index.html.erb +1 -1
- data/app/views/licenses/show.html.erb +1 -1
- data/app/views/manifestation_relationship_types/index.html.erb +1 -1
- data/app/views/manifestation_relationship_types/show.html.erb +1 -1
- data/app/views/manifestation_relationships/_form.html.erb +1 -1
- data/app/views/manifestations/_call_number.html.erb +3 -3
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_export_detail.html.erb +0 -1
- data/app/views/manifestations/_export_list.html.erb +3 -4
- data/app/views/manifestations/_form.html.erb +8 -31
- data/app/views/manifestations/_identifier_fields.html.erb +1 -1
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_show_creators.html.erb +1 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +13 -37
- data/app/views/manifestations/_show_detail_user.html.erb +13 -25
- data/app/views/manifestations/_show_holding.html+phone.erb +3 -3
- data/app/views/manifestations/_show_holding.html.erb +2 -2
- data/app/views/manifestations/explain.sru +9 -0
- data/app/views/manifestations/index.atom.builder +1 -1
- data/app/views/manifestations/index.html.erb +7 -7
- data/app/views/manifestations/index.opds.builder +1 -1
- data/app/views/manifestations/index.rdf.builder +3 -3
- data/app/views/manifestations/index.rss.builder +3 -3
- data/app/views/manifestations/index.sru.builder +101 -0
- data/app/views/manifestations/index.txt.erb +1 -0
- data/app/views/manifestations/show.txt.erb +1 -0
- data/app/views/medium_of_performances/index.html.erb +1 -1
- data/app/views/medium_of_performances/show.html.erb +1 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/edit.html.erb +0 -4
- data/app/views/produce_types/index.html.erb +1 -1
- data/app/views/produce_types/show.html.erb +1 -1
- data/app/views/produces/_form.html.erb +1 -1
- data/app/views/realize_types/index.html.erb +1 -1
- data/app/views/realize_types/show.html.erb +1 -1
- data/app/views/realizes/_form.html.erb +1 -1
- data/app/views/resource_import_files/_results.html.erb +0 -6
- data/app/views/resource_import_files/new.html.erb +2 -2
- data/app/views/resource_import_results/index.html.erb +11 -0
- data/app/views/resource_import_results/index.txt.erb +3 -0
- data/app/views/series_statements/_form.html.erb +8 -6
- data/app/views/series_statements/show.html.erb +0 -12
- data/config/locales/translation_en.yml +1 -28
- data/config/locales/translation_ja.yml +3 -30
- data/config/routes.rb +0 -2
- data/db/migrate/20081027150907_create_picture_files.rb +2 -0
- data/db/migrate/20160319144230_create_issn_records.rb +11 -0
- data/db/migrate/20160506144040_create_isbn_records.rb +11 -0
- data/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
- data/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
- data/db/migrate/20190102034126_create_doi_records.rb +13 -0
- data/db/migrate/20190311154610_create_periodicals.rb +10 -0
- data/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
- data/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
- data/lib/enju_biblio/openurl.rb +1 -5
- data/lib/enju_biblio/porta_cql.rb +282 -0
- data/lib/enju_biblio/sru.rb +83 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +2 -0
- data/lib/generators/enju_biblio/setup/setup_generator.rb +0 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_relationship_types.yml +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_types.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/carrier_types.yml +8 -26
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +12 -24
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/create_types.yml +4 -22
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/form_of_works.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/frequencies.yml +9 -18
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/languages.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/licenses.yml +2 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/manifestation_relationship_types.yml +2 -4
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/medium_of_performances.yml +15 -0
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/produce_types.yml +2 -19
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/realize_types.yml +3 -21
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/assigns_a_newly_created_import_request_as_import_request.yml +121 -0
- data/spec/controllers/content_types_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +1 -59
- data/spec/controllers/manifestations_controller_spec.rb +19 -49
- data/spec/dummy/app/helpers/application_helper.rb +1 -1
- data/spec/dummy/app/models/user.rb +4 -0
- data/spec/dummy/bin/bundle +1 -1
- data/spec/dummy/bin/setup +1 -3
- data/spec/dummy/bin/update +4 -2
- data/spec/dummy/bin/yarn +3 -3
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/config/database.yml +70 -9
- data/spec/dummy/config/initializers/assets.rb +2 -2
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -0
- data/spec/dummy/db/migrate/113_create_events.rb +2 -4
- data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -0
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
- data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
- data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
- data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
- data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
- data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
- data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
- data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
- data/spec/dummy/db/migrate/20180709161346_add_created_at_to_tag.rb +6 -0
- data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
- data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
- data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
- data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
- data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
- data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
- data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
- data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
- data/spec/dummy/db/schema.rb +335 -221
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/create_types.rb +8 -7
- data/spec/factories/produce_types.rb +8 -7
- data/spec/factories/realize_types.rb +8 -7
- data/spec/factories/series_statement.rb +3 -4
- data/spec/fixtures/agent_relationship_types.yml +8 -7
- data/spec/fixtures/agent_types.yml +11 -10
- data/spec/fixtures/carrier_types.yml +16 -15
- data/spec/fixtures/content_types.yml +20 -31
- data/spec/fixtures/create_types.yml +12 -15
- data/spec/fixtures/creates.yml +0 -2
- data/spec/fixtures/form_of_works.yml +11 -10
- data/spec/fixtures/frequencies.yml +17 -25
- data/spec/fixtures/items.yml +11 -12
- data/spec/fixtures/languages.yml +11 -11
- data/spec/fixtures/libraries.yml +30 -30
- data/spec/fixtures/library_groups.yml +11 -6
- data/spec/fixtures/licenses.yml +8 -7
- data/spec/fixtures/manifestation_relationship_types.yml +12 -11
- data/spec/fixtures/manifestations.yml +0 -1
- data/spec/fixtures/medium_of_performances.yml +10 -9
- data/spec/fixtures/picture_files.yml +2 -0
- data/spec/fixtures/produce_types.yml +10 -11
- data/spec/fixtures/produces.yml +0 -2
- data/spec/fixtures/profiles.yml +8 -5
- data/spec/fixtures/realize_types.yml +11 -13
- data/spec/fixtures/realizes.yml +0 -2
- data/spec/fixtures/request_status_types.yml +14 -14
- data/spec/fixtures/request_types.yml +13 -13
- data/spec/fixtures/resource_export_files.yml +1 -1
- data/spec/fixtures/resource_import_results.yml +2 -2
- data/spec/fixtures/roles.yml +22 -5
- data/spec/fixtures/shelves.yml +16 -16
- data/spec/fixtures/user_groups.yml +12 -12
- data/spec/fixtures/user_has_roles.yml +3 -4
- data/spec/fixtures/users.yml +0 -3
- data/spec/models/agent_relationship_type_spec.rb +8 -7
- data/spec/models/agent_type_spec.rb +8 -7
- data/spec/models/carrier_type_spec.rb +12 -11
- data/spec/models/content_type_spec.rb +8 -7
- data/spec/models/create_type_spec.rb +8 -7
- data/spec/models/doi_record_spec.rb +19 -0
- data/spec/models/form_of_work_spec.rb +8 -7
- data/spec/models/frequency_spec.rb +8 -7
- data/spec/models/item_spec.rb +0 -7
- data/spec/models/language_spec.rb +10 -9
- data/spec/models/license_spec.rb +8 -7
- data/spec/models/manifestation_relationship_type_spec.rb +8 -7
- data/spec/models/manifestation_spec.rb +81 -24
- data/spec/models/medium_of_performance_spec.rb +8 -7
- data/spec/models/periodical_and_manifestation_spec.rb +17 -0
- data/spec/models/periodical_spec.rb +16 -0
- data/spec/models/picture_file_spec.rb +2 -0
- data/spec/models/produce_type_spec.rb +8 -7
- data/spec/models/realize_type_spec.rb +8 -7
- data/spec/models/resource_export_file_spec.rb +9 -62
- data/spec/models/resource_import_file_spec.rb +14 -44
- data/spec/rails_helper.rb +8 -4
- data/spec/system/manifestations_spec.rb +0 -30
- data/spec/views/items/index.html.erb_spec.rb +6 -7
- data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
- data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -0
- data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.txt.erb_spec.rb} +1 -1
- data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.txt.erb_spec.rb} +2 -2
- data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
- metadata +560 -718
- data/app/controllers/item_custom_properties_controller.rb +0 -69
- data/app/controllers/manifestation_custom_properties_controller.rb +0 -69
- data/app/models/item_custom_property.rb +0 -18
- data/app/models/item_custom_value.rb +0 -17
- data/app/models/manifestation_custom_property.rb +0 -18
- data/app/models/manifestation_custom_value.rb +0 -17
- data/app/policies/item_custom_property_policy.rb +0 -21
- data/app/policies/manifestation_custom_property_policy.rb +0 -21
- data/app/views/agent_import_results/index.txt.ruby +0 -5
- data/app/views/item_custom_properties/_form.html.erb +0 -32
- data/app/views/item_custom_properties/edit.html.erb +0 -13
- data/app/views/item_custom_properties/index.html.erb +0 -43
- data/app/views/item_custom_properties/new.html.erb +0 -12
- data/app/views/item_custom_properties/show.html.erb +0 -28
- data/app/views/items/_item.json.jbuilder +0 -17
- data/app/views/items/index.json.jbuilder +0 -5
- data/app/views/items/show.json.jbuilder +0 -1
- data/app/views/manifestation_custom_properties/_form.html.erb +0 -32
- data/app/views/manifestation_custom_properties/edit.html.erb +0 -13
- data/app/views/manifestation_custom_properties/index.html.erb +0 -43
- data/app/views/manifestation_custom_properties/new.html.erb +0 -12
- data/app/views/manifestation_custom_properties/show.html.erb +0 -28
- data/app/views/manifestations/index.txt.ruby +0 -7
- data/app/views/manifestations/show.json.jbuilder +0 -2
- data/app/views/manifestations/show.txt.ruby +0 -5
- data/app/views/resource_import_results/index.txt.ruby +0 -5
- data/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
- data/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
- data/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
- data/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
- data/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
- data/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/agents.yml +0 -19
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_import_custom_values.yml +0 -121
- data/spec/cassette_library/resource_import_results/index_txt_ruby/renders_a_list_of_resource_import_results.yml +0 -121
- data/spec/controllers/item_custom_properties_controller_spec.rb +0 -449
- data/spec/controllers/manifestation_custom_properties_controller_spec.rb +0 -449
- data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +0 -18
- data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +0 -17
- data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +0 -15
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
- data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +0 -5
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
- data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
- data/spec/factories/item_custom_property.rb +0 -6
- data/spec/factories/item_custom_value.rb +0 -6
- data/spec/factories/manifestation_custom_property.rb +0 -6
- data/spec/factories/manifestation_custom_value.rb +0 -6
- data/spec/fixtures/carrier_type_has_checkout_types.yml +0 -31
- data/spec/fixtures/checkout_stat_has_manifestations.yml +0 -24
- data/spec/fixtures/checkout_stat_has_users.yml +0 -24
- data/spec/fixtures/checkout_types.yml +0 -34
- data/spec/fixtures/circulation_statuses.yml +0 -136
- data/spec/fixtures/inventory_files.yml +0 -40
- data/spec/fixtures/item_custom_properties.yml +0 -24
- data/spec/fixtures/manifestation_checkout_stats.yml +0 -29
- data/spec/fixtures/manifestation_custom_properties.yml +0 -24
- data/spec/fixtures/manifestation_reserve_stats.yml +0 -29
- data/spec/fixtures/reserve_stat_has_manifestations.yml +0 -24
- data/spec/fixtures/reserve_stat_has_users.yml +0 -24
- data/spec/fixtures/reserve_transitions.yml +0 -104
- data/spec/fixtures/reserves.yml +0 -143
- data/spec/fixtures/use_restrictions.yml +0 -93
- data/spec/fixtures/user_checkout_stats.yml +0 -28
- data/spec/fixtures/user_group_has_checkout_types.yml +0 -111
- data/spec/fixtures/user_reserve_stats.yml +0 -28
- data/spec/models/item_custom_property_spec.rb +0 -18
- data/spec/models/item_custom_value_spec.rb +0 -17
- data/spec/models/manifestation_custom_property_spec.rb +0 -18
- data/spec/models/manifestation_custom_value_spec.rb +0 -17
- data/spec/requests/item_custom_properties_spec.rb +0 -129
- data/spec/requests/manifestation_custom_properties_spec.rb +0 -129
- data/spec/routing/item_custom_properties_routing_spec.rb +0 -38
- data/spec/routing/manifestation_custom_properties_routing_spec.rb +0 -38
- data/spec/system/items_spec.rb +0 -121
- data/spec/system/series_statements_spec.rb +0 -16
- data/spec/views/agent_import_results/index.html.erb_spec.rb +0 -29
- data/spec/views/agent_import_results/index.txt.ruby_spec.rb +0 -20
- data/spec/views/agent_import_results/show.html.erb_spec.rb +0 -24
- data/spec/views/item_custom_properties/edit.html.erb_spec.rb +0 -21
- data/spec/views/item_custom_properties/index.html.erb_spec.rb +0 -25
- data/spec/views/item_custom_properties/new.html.erb_spec.rb +0 -21
- data/spec/views/item_custom_properties/show.html.erb_spec.rb +0 -16
- data/spec/views/items/index.json.jbuilder_spec.rb +0 -15
- data/spec/views/items/show.json.jbuilder_spec.rb +0 -15
- data/spec/views/manifestation_custom_properties/edit.html.erb_spec.rb +0 -21
- data/spec/views/manifestation_custom_properties/index.html.erb_spec.rb +0 -25
- data/spec/views/manifestation_custom_properties/new.html.erb_spec.rb +0 -21
- data/spec/views/manifestation_custom_properties/show.html.erb_spec.rb +0 -16
- data/spec/views/manifestations/show.json.jbuilder_spec.rb +0 -16
- data/spec/views/resource_import_results/index.txt.ruby_spec.rb +0 -22
data/spec/fixtures/shelves.yml
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
---
|
2
2
|
shelf_00001:
|
3
3
|
name: web
|
4
|
-
|
4
|
+
display_name_translations: {"en": "Library bookmark", "ja": "ブックマーク"}
|
5
5
|
id: 1
|
6
6
|
note:
|
7
7
|
library_id: 1
|
8
8
|
position: 1
|
9
9
|
shelf_00002:
|
10
10
|
name: first_shelf
|
11
|
-
|
11
|
+
display_name_translations: {"en": "First shelf", "ja": "最初の書棚"}
|
12
12
|
id: 2
|
13
13
|
note:
|
14
14
|
library_id: 2
|
15
15
|
position: 2
|
16
16
|
shelf_00003:
|
17
17
|
name: second_shelf
|
18
|
-
|
18
|
+
display_name_translations: {"en": "Second shelf", "ja": "二つ目の書棚"}
|
19
19
|
id: 3
|
20
20
|
note:
|
21
21
|
library_id: 2
|
22
22
|
position: 3
|
23
23
|
shelf_00004:
|
24
24
|
name: third_shelf
|
25
|
-
|
25
|
+
display_name_translations: {"en": "Third shelf", "ja": "三つ目の書棚"}
|
26
26
|
id: 4
|
27
27
|
note:
|
28
28
|
library_id: 3
|
@@ -32,16 +32,16 @@ shelf_00004:
|
|
32
32
|
#
|
33
33
|
# Table name: shelves
|
34
34
|
#
|
35
|
-
# id
|
36
|
-
# name
|
37
|
-
# display_name
|
38
|
-
# note
|
39
|
-
# library_id
|
40
|
-
# items_count
|
41
|
-
# position
|
42
|
-
# created_at
|
43
|
-
# updated_at
|
44
|
-
# deleted_at
|
45
|
-
# closed
|
35
|
+
# id :integer not null, primary key
|
36
|
+
# name :string not null
|
37
|
+
# display_name :text
|
38
|
+
# note :text
|
39
|
+
# library_id :integer not null
|
40
|
+
# items_count :integer default(0), not null
|
41
|
+
# position :integer
|
42
|
+
# created_at :datetime
|
43
|
+
# updated_at :datetime
|
44
|
+
# deleted_at :datetime
|
45
|
+
# closed :boolean default(FALSE), not null
|
46
|
+
# display_name_translations :jsonb not null
|
46
47
|
#
|
47
|
-
|
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
user_group_00001:
|
3
3
|
name: not_specified
|
4
|
-
|
4
|
+
display_name_translations: {"en": "(not specified)", "ja": "不明"}
|
5
5
|
updated_at: 2007-12-13 21:00:51.564542 +09:00
|
6
6
|
id: 1
|
7
7
|
note: ""
|
@@ -11,7 +11,7 @@ user_group_00001:
|
|
11
11
|
number_of_day_to_notify_due_date: 2
|
12
12
|
user_group_00002:
|
13
13
|
name: user
|
14
|
-
|
14
|
+
display_name_translations: {"en": "User", "ja": "一般利用者"}
|
15
15
|
updated_at: 2007-12-23 03:14:56.836548 +09:00
|
16
16
|
id: 2
|
17
17
|
note: ""
|
@@ -22,7 +22,7 @@ user_group_00002:
|
|
22
22
|
number_of_time_to_notify_overdue: 6
|
23
23
|
user_group_00003:
|
24
24
|
name: faculty
|
25
|
-
|
25
|
+
display_name_translations: {"en": "Faculty", "ja": "教職員"}
|
26
26
|
updated_at: 2007-12-23 03:15:05.134351 +09:00
|
27
27
|
id: 3
|
28
28
|
note: ""
|
@@ -34,18 +34,18 @@ user_group_00003:
|
|
34
34
|
#
|
35
35
|
# Table name: user_groups
|
36
36
|
#
|
37
|
-
# id :integer
|
38
|
-
# name :string
|
37
|
+
# id :integer not null, primary key
|
38
|
+
# name :string
|
39
39
|
# display_name :text
|
40
40
|
# note :text
|
41
41
|
# position :integer
|
42
|
-
# created_at :datetime
|
43
|
-
# updated_at :datetime
|
42
|
+
# created_at :datetime
|
43
|
+
# updated_at :datetime
|
44
44
|
# deleted_at :datetime
|
45
|
-
# valid_period_for_new_user :integer
|
45
|
+
# valid_period_for_new_user :integer default(0), not null
|
46
46
|
# expired_at :datetime
|
47
|
-
# number_of_day_to_notify_overdue :integer
|
48
|
-
# number_of_day_to_notify_due_date :integer
|
49
|
-
# number_of_time_to_notify_overdue :integer
|
47
|
+
# number_of_day_to_notify_overdue :integer default(7), not null
|
48
|
+
# number_of_day_to_notify_due_date :integer default(3), not null
|
49
|
+
# number_of_time_to_notify_overdue :integer default(3), not null
|
50
|
+
# display_name_translations :jsonb not null
|
50
51
|
#
|
51
|
-
|
@@ -32,10 +32,9 @@ user4:
|
|
32
32
|
#
|
33
33
|
# Table name: user_has_roles
|
34
34
|
#
|
35
|
-
# id :integer
|
36
|
-
# user_id :integer
|
37
|
-
# role_id :integer
|
35
|
+
# id :integer not null, primary key
|
36
|
+
# user_id :integer not null
|
37
|
+
# role_id :integer not null
|
38
38
|
# created_at :datetime
|
39
39
|
# updated_at :datetime
|
40
40
|
#
|
41
|
-
|
data/spec/fixtures/users.yml
CHANGED
@@ -6,7 +6,6 @@ admin:
|
|
6
6
|
username: enjuadmin
|
7
7
|
email: tanabe@kamata.lib.teu.ac.jp
|
8
8
|
created_at: 2007-11-19 16:58:32.111941 +09:00
|
9
|
-
save_checkout_history: true
|
10
9
|
librarian1:
|
11
10
|
updated_at: 2008-05-31 12:41:16.337474 +09:00
|
12
11
|
encrypted_password: $2a$10$9O2VuTccN4gHq36ARg0QReSrb1D7WrBBhZZ759RM9moHbB0W5zCzS
|
@@ -14,7 +13,6 @@ librarian1:
|
|
14
13
|
username: librarian1
|
15
14
|
email: librarian1@kamata.lib.teu.ac.jp
|
16
15
|
created_at: 2007-11-19 16:58:33.172441 +09:00
|
17
|
-
save_checkout_history: false
|
18
16
|
user1:
|
19
17
|
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
20
18
|
encrypted_password: $2a$10$JthS59A0BNkDOoFpCXM0V.GhhffKaoWKbzpPahYp/vTFrOyM7h/uW
|
@@ -22,7 +20,6 @@ user1:
|
|
22
20
|
username: user1
|
23
21
|
email: user1@kamata.lib.teu.ac.jp
|
24
22
|
created_at: 2007-11-19 16:58:34.637413 +09:00
|
25
|
-
save_checkout_history: true
|
26
23
|
librarian2:
|
27
24
|
updated_at: 2008-05-31 12:42:23.340575 +09:00
|
28
25
|
encrypted_password: $2a$10$YmmTGrYQ1Ir6oc7wXnp.GuNeO1eYLoP3sv8wMSIrTdaGw2BPwRrpS
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: agent_relationship_types
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: agent_types
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -13,15 +13,16 @@ end
|
|
13
13
|
#
|
14
14
|
# Table name: carrier_types
|
15
15
|
#
|
16
|
-
# id
|
17
|
-
# name
|
18
|
-
# display_name
|
19
|
-
# note
|
20
|
-
# position
|
21
|
-
# created_at
|
22
|
-
# updated_at
|
23
|
-
# attachment_file_name
|
24
|
-
# attachment_content_type
|
25
|
-
# attachment_file_size
|
26
|
-
# attachment_updated_at
|
16
|
+
# id :integer not null, primary key
|
17
|
+
# name :string not null
|
18
|
+
# display_name :text
|
19
|
+
# note :text
|
20
|
+
# position :integer
|
21
|
+
# created_at :datetime
|
22
|
+
# updated_at :datetime
|
23
|
+
# attachment_file_name :string
|
24
|
+
# attachment_content_type :string
|
25
|
+
# attachment_file_size :bigint
|
26
|
+
# attachment_updated_at :datetime
|
27
|
+
# display_name_translations :jsonb not null
|
27
28
|
#
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: content_types
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -10,11 +10,12 @@ end
|
|
10
10
|
#
|
11
11
|
# Table name: create_types
|
12
12
|
#
|
13
|
-
# id
|
14
|
-
# name
|
15
|
-
# display_name
|
16
|
-
# note
|
17
|
-
# position
|
18
|
-
# created_at
|
19
|
-
# updated_at
|
13
|
+
# id :integer not null, primary key
|
14
|
+
# name :string
|
15
|
+
# display_name :text
|
16
|
+
# note :text
|
17
|
+
# position :integer
|
18
|
+
# created_at :datetime
|
19
|
+
# updated_at :datetime
|
20
|
+
# display_name_translations :jsonb not null
|
20
21
|
#
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe DoiRecord, type: :model do
|
4
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
5
|
+
end
|
6
|
+
|
7
|
+
# == Schema Information
|
8
|
+
#
|
9
|
+
# Table name: doi_records
|
10
|
+
#
|
11
|
+
# id :bigint not null, primary key
|
12
|
+
# body :string not null
|
13
|
+
# display_body :string not null
|
14
|
+
# source :string
|
15
|
+
# response :jsonb not null
|
16
|
+
# manifestation_id :bigint not null
|
17
|
+
# created_at :datetime not null
|
18
|
+
# updated_at :datetime not null
|
19
|
+
#
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: form_of_works
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -12,11 +12,12 @@ end
|
|
12
12
|
#
|
13
13
|
# Table name: frequencies
|
14
14
|
#
|
15
|
-
# id
|
16
|
-
# name
|
17
|
-
# display_name
|
18
|
-
# note
|
19
|
-
# position
|
20
|
-
# created_at
|
21
|
-
# updated_at
|
15
|
+
# id :integer not null, primary key
|
16
|
+
# name :string not null
|
17
|
+
# display_name :text
|
18
|
+
# note :text
|
19
|
+
# position :integer
|
20
|
+
# created_at :datetime
|
21
|
+
# updated_at :datetime
|
22
|
+
# display_name_translations :jsonb not null
|
22
23
|
#
|
data/spec/models/item_spec.rb
CHANGED
@@ -7,12 +7,6 @@ describe Item do
|
|
7
7
|
it "should have library_url" do
|
8
8
|
items(:item_00001).library_url.should eq "#{LibraryGroup.site_config.url}libraries/web"
|
9
9
|
end
|
10
|
-
|
11
|
-
it "should not create item without manifestation_id" do
|
12
|
-
item = items(:item_00001)
|
13
|
-
item.manifestation_id = nil
|
14
|
-
item.valid?.should be_falsy
|
15
|
-
end
|
16
10
|
end
|
17
11
|
|
18
12
|
# == Schema Information
|
@@ -42,5 +36,4 @@ end
|
|
42
36
|
# binding_call_number :string
|
43
37
|
# binded_at :datetime
|
44
38
|
# manifestation_id :integer not null
|
45
|
-
# memo :text
|
46
39
|
#
|
@@ -9,13 +9,14 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: languages
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# native_name
|
15
|
-
# display_name
|
16
|
-
# iso_639_1
|
17
|
-
# iso_639_2
|
18
|
-
# iso_639_3
|
19
|
-
# note
|
20
|
-
# position
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# native_name :string
|
15
|
+
# display_name :text
|
16
|
+
# iso_639_1 :string
|
17
|
+
# iso_639_2 :string
|
18
|
+
# iso_639_3 :string
|
19
|
+
# note :text
|
20
|
+
# position :integer
|
21
|
+
# display_name_translations :jsonb not null
|
21
22
|
#
|
data/spec/models/license_spec.rb
CHANGED
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: licenses
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :string
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: manifestation_relationship_types
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -98,10 +98,83 @@ describe Manifestation, solr: true do
|
|
98
98
|
lambda{Openurl.new({aufirst: "テスト 名称"})}.should raise_error(OpenurlQuerySyntaxError)
|
99
99
|
end
|
100
100
|
|
101
|
+
it "should search in sru" do
|
102
|
+
sru = Sru.new({query: "title=Ruby"})
|
103
|
+
sru.search
|
104
|
+
sru.manifestations.size.should eq 18
|
105
|
+
sru.manifestations.first.titles.first.should eq 'Ruby'
|
106
|
+
sru = Sru.new({query: "title=^ruby"})
|
107
|
+
sru.search
|
108
|
+
sru.manifestations.size.should eq 9
|
109
|
+
sru = Sru.new({query: 'title ALL "awk sed"'})
|
110
|
+
sru.search
|
111
|
+
sru.manifestations.size.should eq 2
|
112
|
+
sru.manifestations.collect{|m| m.id}.should eq [184, 116]
|
113
|
+
sru = Sru.new({query: 'title ANY "ruby awk sed"'})
|
114
|
+
sru.search
|
115
|
+
sru.manifestations.size.should eq 22
|
116
|
+
sru = Sru.new({query: 'isbn=9784756137470'})
|
117
|
+
sru.search
|
118
|
+
sru.manifestations.first.id.should eq 114
|
119
|
+
sru = Sru.new({query: "creator=テスト"})
|
120
|
+
sru.search
|
121
|
+
sru.manifestations.size.should eq 1
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should search date in sru" do
|
125
|
+
sru = Sru.new({query: "from = 2000-09 AND until = 2000-11-01"})
|
126
|
+
sru.search
|
127
|
+
sru.manifestations.size.should eq 1
|
128
|
+
sru.manifestations.first.id.should eq 120
|
129
|
+
sru = Sru.new({query: "from = 1993-02-24"})
|
130
|
+
sru.search
|
131
|
+
sru.manifestations.size.should eq 5
|
132
|
+
sru = Sru.new({query: "until = 2006-08-06"})
|
133
|
+
sru.search
|
134
|
+
sru.manifestations.size.should eq 4
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should accept sort_by in sru" do
|
138
|
+
sru = Sru.new({query: "title=Ruby"})
|
139
|
+
sru.sort_by.should eq({sort_by: 'created_at', order: 'desc'})
|
140
|
+
sru = Sru.new({query: 'title=Ruby AND sortBy="title/sort.ascending"', sortKeys: 'creator,0', version: '1.2'})
|
141
|
+
sru.sort_by.should eq({sort_by: 'sort_title', order: 'asc'})
|
142
|
+
sru = Sru.new({query: 'title=Ruby AND sortBy="title/sort.ascending"', sortKeys: 'creator,0', version: '1.1'})
|
143
|
+
sru.sort_by.should eq({sort_by: 'creator', order: 'desc'})
|
144
|
+
sru = Sru.new({query: 'title=Ruby AND sortBy="title/sort.ascending"', sortKeys: 'creator,1', version: '1.1'})
|
145
|
+
sru.sort_by.should eq({sort_by: 'creator', order: 'asc'})
|
146
|
+
sru = Sru.new({query: 'title=Ruby AND sortBy="title'})
|
147
|
+
sru.sort_by.should eq({sort_by: 'sort_title', order: 'asc'})
|
148
|
+
# TODO ソート基準が入手しやすさの場合の処理
|
149
|
+
end
|
150
|
+
|
151
|
+
it "should accept ranges in sru" do
|
152
|
+
sru = Sru.new({query: "from = 1993-02-24 AND until = 2006-08-06 AND title=プログラミング"})
|
153
|
+
sru.search
|
154
|
+
sru.manifestations.size.should eq 2
|
155
|
+
sru = Sru.new({query: "until = 2000 AND title=プログラミング"})
|
156
|
+
sru.search
|
157
|
+
sru.manifestations.size.should eq 1
|
158
|
+
sru = Sru.new({query: "from = 2006 AND title=プログラミング"})
|
159
|
+
sru.search
|
160
|
+
sru.manifestations.size.should eq 1
|
161
|
+
sru = Sru.new({query: "from = 2007 OR title=awk"})
|
162
|
+
sru.search
|
163
|
+
sru.manifestations.size.should eq 6
|
164
|
+
end
|
165
|
+
|
101
166
|
it "should_get_number_of_pages" do
|
102
167
|
manifestations(:manifestation_00001).number_of_pages.should eq 100
|
103
168
|
end
|
104
169
|
|
170
|
+
it "should get youtube_id" do
|
171
|
+
manifestations(:manifestation_00022).youtube_id.should eq 'BSHBzd9ftDE'
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should get nicovideo_id" do
|
175
|
+
manifestations(:manifestation_00023).nicovideo_id.should eq 'sm3015373'
|
176
|
+
end
|
177
|
+
|
105
178
|
it "should have parent_of_series" do
|
106
179
|
manifestations(:manifestation_00001).parent_of_series.should be_truthy
|
107
180
|
end
|
@@ -154,8 +227,8 @@ describe Manifestation, solr: true do
|
|
154
227
|
csv["item_id"].compact.should_not be_empty
|
155
228
|
csv["item_created_at"].compact.should_not be_empty
|
156
229
|
csv["item_updated_at"].compact.should_not be_empty
|
157
|
-
csv["subject:unknown"].compact.
|
158
|
-
csv["classification:ndc9"].compact.
|
230
|
+
csv["subject:unknown"].compact.should eq manifestations(:manifestation_00001).items.count.times.map{"next-l"}
|
231
|
+
csv["classification:ndc9"].compact.should eq manifestations(:manifestation_00001).items.count.times.map{"400"}
|
159
232
|
csv["extent"].compact.should_not be_empty
|
160
233
|
csv["dimensions"].compact.should_not be_empty
|
161
234
|
end
|
@@ -196,18 +269,18 @@ describe Manifestation, solr: true do
|
|
196
269
|
lines = Manifestation.export()
|
197
270
|
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
198
271
|
m = csv.find{|row| row["manifestation_id"].to_i == manifestation.id }
|
199
|
-
expect(m["
|
272
|
+
expect(m["isbn"]).to eq "9784043898039//9784840239219"
|
200
273
|
end
|
201
274
|
|
202
275
|
it "should respect the role of the user" do
|
203
276
|
FactoryBot.create(:item, bookstore_id: 1, price: 100, budget_type_id: 1)
|
204
|
-
lines = Manifestation.export
|
277
|
+
lines = Manifestation.export
|
205
278
|
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
206
279
|
expect(csv["bookstore"].compact).to be_empty
|
207
280
|
expect(csv["item_price"].compact).to be_empty
|
208
281
|
expect(csv["budget_type"].compact).to be_empty
|
209
282
|
|
210
|
-
lines = Manifestation.export(role:
|
283
|
+
lines = Manifestation.export(format: :txt, role: :Librarian)
|
211
284
|
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
212
285
|
expect(csv["bookstore"].compact).not_to be_empty
|
213
286
|
expect(csv["item_price"].compact).not_to be_empty
|
@@ -223,24 +296,9 @@ describe Manifestation, solr: true do
|
|
223
296
|
expect(csv["note"].compact).not_to be_empty
|
224
297
|
expect(csv["item_note"].compact).not_to be_empty
|
225
298
|
m = csv.find{|row| row["manifestation_id"].to_i == manifestation.id }
|
226
|
-
expect(m["description"]).to eq
|
227
|
-
expect(m["note"]).to eq
|
228
|
-
expect(m["item_note"]).to eq
|
229
|
-
end
|
230
|
-
|
231
|
-
it 'should export custom properties"' do
|
232
|
-
item = FactoryBot.create(:item)
|
233
|
-
item.item_custom_values << FactoryBot.build(:item_custom_value)
|
234
|
-
item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value)
|
235
|
-
lines = Manifestation.export(role: 'Librarian')
|
236
|
-
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
237
|
-
m = csv.find{|row| row["manifestation_id"].to_i == item.manifestation.id }
|
238
|
-
item.item_custom_values.each do |custom_value|
|
239
|
-
expect(m["item:#{custom_value.item_custom_property.name}"]).to eq custom_value.value
|
240
|
-
end
|
241
|
-
item.manifestation.manifestation_custom_values.each do |custom_value|
|
242
|
-
expect(m["manifestation:#{custom_value.manifestation_custom_property.name}"]).to eq custom_value.value
|
243
|
-
end
|
299
|
+
expect(m["description"]).to eq 'test\ntest'
|
300
|
+
expect(m["note"]).to eq 'test\ntest'
|
301
|
+
expect(m["item_note"]).to eq 'test\ntest'
|
244
302
|
end
|
245
303
|
end
|
246
304
|
end
|
@@ -308,5 +366,4 @@ end
|
|
308
366
|
# publication_place :text
|
309
367
|
# extent :text
|
310
368
|
# dimensions :text
|
311
|
-
# memo :text
|
312
369
|
#
|
@@ -9,11 +9,12 @@ end
|
|
9
9
|
#
|
10
10
|
# Table name: medium_of_performances
|
11
11
|
#
|
12
|
-
# id
|
13
|
-
# name
|
14
|
-
# display_name
|
15
|
-
# note
|
16
|
-
# position
|
17
|
-
# created_at
|
18
|
-
# updated_at
|
12
|
+
# id :integer not null, primary key
|
13
|
+
# name :string not null
|
14
|
+
# display_name :text
|
15
|
+
# note :text
|
16
|
+
# position :integer
|
17
|
+
# created_at :datetime
|
18
|
+
# updated_at :datetime
|
19
|
+
# display_name_translations :jsonb not null
|
19
20
|
#
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe PeriodicalAndManifestation, type: :model do
|
4
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
5
|
+
end
|
6
|
+
|
7
|
+
# == Schema Information
|
8
|
+
#
|
9
|
+
# Table name: periodical_and_manifestations
|
10
|
+
#
|
11
|
+
# id :bigint not null, primary key
|
12
|
+
# periodical_id :bigint not null
|
13
|
+
# manifestation_id :bigint not null
|
14
|
+
# periodical_master :boolean default(FALSE), not null
|
15
|
+
# created_at :datetime not null
|
16
|
+
# updated_at :datetime not null
|
17
|
+
#
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe Periodical, type: :model do
|
4
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
5
|
+
end
|
6
|
+
|
7
|
+
# == Schema Information
|
8
|
+
#
|
9
|
+
# Table name: periodicals
|
10
|
+
#
|
11
|
+
# id :bigint not null, primary key
|
12
|
+
# original_title :text not null
|
13
|
+
# frequency_id :bigint not null
|
14
|
+
# created_at :datetime not null
|
15
|
+
# updated_at :datetime not null
|
16
|
+
#
|
@@ -10,11 +10,12 @@ end
|
|
10
10
|
#
|
11
11
|
# Table name: produce_types
|
12
12
|
#
|
13
|
-
# id
|
14
|
-
# name
|
15
|
-
# display_name
|
16
|
-
# note
|
17
|
-
# position
|
18
|
-
# created_at
|
19
|
-
# updated_at
|
13
|
+
# id :integer not null, primary key
|
14
|
+
# name :string
|
15
|
+
# display_name :text
|
16
|
+
# note :text
|
17
|
+
# position :integer
|
18
|
+
# created_at :datetime
|
19
|
+
# updated_at :datetime
|
20
|
+
# display_name_translations :jsonb not null
|
20
21
|
#
|