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.
Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/agents_controller.rb +6 -0
  4. data/app/controllers/content_types_controller.rb +1 -1
  5. data/app/controllers/items_controller.rb +10 -18
  6. data/app/controllers/manifestations_controller.rb +85 -80
  7. data/app/controllers/resource_import_results_controller.rb +2 -6
  8. data/app/controllers/series_statements_controller.rb +6 -0
  9. data/app/helpers/enju_biblio/application_helper.rb +5 -5
  10. data/app/helpers/manifestations_helper.rb +12 -12
  11. data/app/models/agent.rb +4 -13
  12. data/app/models/agent_import_file.rb +1 -1
  13. data/app/models/agent_relationship_type.rb +8 -7
  14. data/app/models/agent_type.rb +10 -7
  15. data/app/models/carrier_type.rb +14 -11
  16. data/app/models/content_type.rb +10 -7
  17. data/app/models/create_type.rb +8 -7
  18. data/app/models/doi_record.rb +36 -0
  19. data/app/models/form_of_work.rb +11 -8
  20. data/app/models/frequency.rb +11 -8
  21. data/app/models/identifier.rb +1 -1
  22. data/app/models/identifier_type.rb +1 -0
  23. data/app/models/import_request.rb +3 -4
  24. data/app/models/isbn_record.rb +51 -0
  25. data/app/models/isbn_record_and_manifestation.rb +18 -0
  26. data/app/models/issn_record.rb +49 -0
  27. data/app/models/issn_record_and_manifestation.rb +18 -0
  28. data/app/models/item.rb +7 -55
  29. data/app/models/language.rb +10 -9
  30. data/app/models/license.rb +9 -7
  31. data/app/models/manifestation.rb +271 -158
  32. data/app/models/manifestation_relationship_type.rb +9 -7
  33. data/app/models/medium_of_performance.rb +11 -8
  34. data/app/models/periodical.rb +33 -0
  35. data/app/models/periodical_and_manifestation.rb +16 -0
  36. data/app/models/picture_file.rb +2 -0
  37. data/app/models/produce_type.rb +8 -7
  38. data/app/models/realize_type.rb +8 -7
  39. data/app/models/resource_export_file.rb +8 -6
  40. data/app/models/resource_export_file_state_machine.rb +1 -1
  41. data/app/models/resource_import_file.rb +62 -153
  42. data/app/views/agent_import_results/index.txt.erb +3 -0
  43. data/app/views/agent_relationship_types/index.html.erb +1 -1
  44. data/app/views/agent_relationship_types/show.html.erb +1 -1
  45. data/app/views/agent_relationships/_form.html.erb +1 -1
  46. data/app/views/agent_types/index.html.erb +1 -1
  47. data/app/views/agent_types/show.html.erb +1 -1
  48. data/app/views/agents/_agent.html.erb +1 -1
  49. data/app/views/agents/_agent_list.html.erb +2 -2
  50. data/app/views/agents/_form.html.erb +4 -4
  51. data/app/views/agents/_index_agent.html.erb +1 -1
  52. data/app/views/agents/_index_agent_merge_list.html.erb +1 -1
  53. data/app/views/agents/_index_expression.html.erb +2 -2
  54. data/app/views/agents/_index_manifestation.html.erb +2 -2
  55. data/app/views/agents/_index_work.html.erb +2 -2
  56. data/app/views/agents/index.atom.builder +1 -1
  57. data/app/views/agents/index.rss.builder +3 -3
  58. data/app/views/agents/show.html+phone.erb +2 -2
  59. data/app/views/agents/show.html.erb +2 -2
  60. data/app/views/carrier_types/index.html.erb +2 -2
  61. data/app/views/carrier_types/show.html.erb +3 -3
  62. data/app/views/content_types/index.html.erb +1 -1
  63. data/app/views/content_types/show.html.erb +1 -1
  64. data/app/views/countries/index.html.erb +1 -1
  65. data/app/views/countries/show.html.erb +1 -1
  66. data/app/views/create_types/index.html.erb +1 -1
  67. data/app/views/create_types/show.html.erb +1 -1
  68. data/app/views/creates/_form.html.erb +1 -1
  69. data/app/views/form_of_works/index.html.erb +1 -1
  70. data/app/views/form_of_works/show.html.erb +1 -1
  71. data/app/views/frequencies/index.html.erb +1 -1
  72. data/app/views/frequencies/show.html.erb +1 -1
  73. data/app/views/identifier_types/index.html.erb +1 -1
  74. data/app/views/identifier_types/show.html.erb +1 -1
  75. data/app/views/items/_form.html.erb +13 -33
  76. data/app/views/items/index.html+phone.erb +3 -3
  77. data/app/views/items/index.html.erb +3 -3
  78. data/app/views/items/show.html+phone.erb +5 -5
  79. data/app/views/items/show.html.erb +119 -134
  80. data/app/views/languages/index.html.erb +1 -1
  81. data/app/views/languages/show.html.erb +1 -1
  82. data/app/views/layouts/agents.html.erb +2 -2
  83. data/app/views/layouts/items.html.erb +1 -1
  84. data/app/views/layouts/manifestations.html.erb +4 -4
  85. data/app/views/licenses/index.html.erb +1 -1
  86. data/app/views/licenses/show.html.erb +1 -1
  87. data/app/views/manifestation_relationship_types/index.html.erb +1 -1
  88. data/app/views/manifestation_relationship_types/show.html.erb +1 -1
  89. data/app/views/manifestation_relationships/_form.html.erb +1 -1
  90. data/app/views/manifestations/_call_number.html.erb +3 -3
  91. data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
  92. data/app/views/manifestations/_classification_facet.html.erb +2 -2
  93. data/app/views/manifestations/_export_detail.html.erb +0 -1
  94. data/app/views/manifestations/_export_list.html.erb +3 -4
  95. data/app/views/manifestations/_form.html.erb +8 -31
  96. data/app/views/manifestations/_identifier_fields.html.erb +1 -1
  97. data/app/views/manifestations/_language_facet.html.erb +1 -1
  98. data/app/views/manifestations/_library_facet.html.erb +1 -1
  99. data/app/views/manifestations/_manifestation.txt.erb +1 -1
  100. data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
  101. data/app/views/manifestations/_reservable_facet.html.erb +2 -2
  102. data/app/views/manifestations/_show_creators.html.erb +1 -1
  103. data/app/views/manifestations/_show_detail_librarian.html.erb +13 -37
  104. data/app/views/manifestations/_show_detail_user.html.erb +13 -25
  105. data/app/views/manifestations/_show_holding.html+phone.erb +3 -3
  106. data/app/views/manifestations/_show_holding.html.erb +2 -2
  107. data/app/views/manifestations/explain.sru +9 -0
  108. data/app/views/manifestations/index.atom.builder +1 -1
  109. data/app/views/manifestations/index.html.erb +7 -7
  110. data/app/views/manifestations/index.opds.builder +1 -1
  111. data/app/views/manifestations/index.rdf.builder +3 -3
  112. data/app/views/manifestations/index.rss.builder +3 -3
  113. data/app/views/manifestations/index.sru.builder +101 -0
  114. data/app/views/manifestations/index.txt.erb +1 -0
  115. data/app/views/manifestations/show.txt.erb +1 -0
  116. data/app/views/medium_of_performances/index.html.erb +1 -1
  117. data/app/views/medium_of_performances/show.html.erb +1 -1
  118. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  119. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  120. data/app/views/picture_files/edit.html.erb +0 -4
  121. data/app/views/produce_types/index.html.erb +1 -1
  122. data/app/views/produce_types/show.html.erb +1 -1
  123. data/app/views/produces/_form.html.erb +1 -1
  124. data/app/views/realize_types/index.html.erb +1 -1
  125. data/app/views/realize_types/show.html.erb +1 -1
  126. data/app/views/realizes/_form.html.erb +1 -1
  127. data/app/views/resource_import_files/_results.html.erb +0 -6
  128. data/app/views/resource_import_files/new.html.erb +2 -2
  129. data/app/views/resource_import_results/index.html.erb +11 -0
  130. data/app/views/resource_import_results/index.txt.erb +3 -0
  131. data/app/views/series_statements/_form.html.erb +8 -6
  132. data/app/views/series_statements/show.html.erb +0 -12
  133. data/config/locales/translation_en.yml +1 -28
  134. data/config/locales/translation_ja.yml +3 -30
  135. data/config/routes.rb +0 -2
  136. data/db/migrate/20081027150907_create_picture_files.rb +2 -0
  137. data/db/migrate/20160319144230_create_issn_records.rb +11 -0
  138. data/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  139. data/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  140. data/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  141. data/db/migrate/20190102034126_create_doi_records.rb +13 -0
  142. data/db/migrate/20190311154610_create_periodicals.rb +10 -0
  143. data/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
  144. data/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  145. data/lib/enju_biblio/openurl.rb +1 -5
  146. data/lib/enju_biblio/porta_cql.rb +282 -0
  147. data/lib/enju_biblio/sru.rb +83 -0
  148. data/lib/enju_biblio/version.rb +1 -1
  149. data/lib/enju_biblio.rb +2 -0
  150. data/lib/generators/enju_biblio/setup/setup_generator.rb +0 -2
  151. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_relationship_types.yml +3 -3
  152. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_types.yml +2 -4
  153. data/lib/generators/enju_biblio/setup/templates/db/fixtures/carrier_types.yml +8 -26
  154. data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +12 -24
  155. data/lib/generators/enju_biblio/setup/templates/db/fixtures/create_types.yml +4 -22
  156. data/lib/generators/enju_biblio/setup/templates/db/fixtures/form_of_works.yml +1 -1
  157. data/lib/generators/enju_biblio/setup/templates/db/fixtures/frequencies.yml +9 -18
  158. data/lib/generators/enju_biblio/setup/templates/db/fixtures/languages.yml +2 -4
  159. data/lib/generators/enju_biblio/setup/templates/db/fixtures/licenses.yml +2 -2
  160. data/lib/generators/enju_biblio/setup/templates/db/fixtures/manifestation_relationship_types.yml +2 -4
  161. data/lib/generators/enju_biblio/setup/templates/db/fixtures/medium_of_performances.yml +15 -0
  162. data/lib/generators/enju_biblio/setup/templates/db/fixtures/produce_types.yml +2 -19
  163. data/lib/generators/enju_biblio/setup/templates/db/fixtures/realize_types.yml +3 -21
  164. 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
  165. data/spec/controllers/content_types_controller_spec.rb +1 -1
  166. data/spec/controllers/items_controller_spec.rb +1 -59
  167. data/spec/controllers/manifestations_controller_spec.rb +19 -49
  168. data/spec/dummy/app/helpers/application_helper.rb +1 -1
  169. data/spec/dummy/app/models/user.rb +4 -0
  170. data/spec/dummy/bin/bundle +1 -1
  171. data/spec/dummy/bin/setup +1 -3
  172. data/spec/dummy/bin/update +4 -2
  173. data/spec/dummy/bin/yarn +3 -3
  174. data/spec/dummy/config/application.rb +1 -2
  175. data/spec/dummy/config/database.yml +70 -9
  176. data/spec/dummy/config/initializers/assets.rb +2 -2
  177. data/spec/dummy/db/development.sqlite3 +0 -0
  178. data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -0
  179. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  180. data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
  181. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
  182. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  183. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  184. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  185. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -0
  186. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
  187. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
  188. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
  189. data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
  190. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  191. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  192. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
  193. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  194. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  195. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  196. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  197. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  198. data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
  199. data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
  200. data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
  201. data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
  202. data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
  203. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
  204. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
  205. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  206. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  207. data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
  208. data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
  209. data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
  210. data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
  211. data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
  212. data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
  213. data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
  214. data/spec/dummy/db/migrate/20180709161346_add_created_at_to_tag.rb +6 -0
  215. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  216. data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
  217. data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
  218. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  219. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  220. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  221. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  222. data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  223. data/spec/dummy/db/schema.rb +335 -221
  224. data/spec/dummy/db/test.sqlite3 +0 -0
  225. data/spec/factories/create_types.rb +8 -7
  226. data/spec/factories/produce_types.rb +8 -7
  227. data/spec/factories/realize_types.rb +8 -7
  228. data/spec/factories/series_statement.rb +3 -4
  229. data/spec/fixtures/agent_relationship_types.yml +8 -7
  230. data/spec/fixtures/agent_types.yml +11 -10
  231. data/spec/fixtures/carrier_types.yml +16 -15
  232. data/spec/fixtures/content_types.yml +20 -31
  233. data/spec/fixtures/create_types.yml +12 -15
  234. data/spec/fixtures/creates.yml +0 -2
  235. data/spec/fixtures/form_of_works.yml +11 -10
  236. data/spec/fixtures/frequencies.yml +17 -25
  237. data/spec/fixtures/items.yml +11 -12
  238. data/spec/fixtures/languages.yml +11 -11
  239. data/spec/fixtures/libraries.yml +30 -30
  240. data/spec/fixtures/library_groups.yml +11 -6
  241. data/spec/fixtures/licenses.yml +8 -7
  242. data/spec/fixtures/manifestation_relationship_types.yml +12 -11
  243. data/spec/fixtures/manifestations.yml +0 -1
  244. data/spec/fixtures/medium_of_performances.yml +10 -9
  245. data/spec/fixtures/picture_files.yml +2 -0
  246. data/spec/fixtures/produce_types.yml +10 -11
  247. data/spec/fixtures/produces.yml +0 -2
  248. data/spec/fixtures/profiles.yml +8 -5
  249. data/spec/fixtures/realize_types.yml +11 -13
  250. data/spec/fixtures/realizes.yml +0 -2
  251. data/spec/fixtures/request_status_types.yml +14 -14
  252. data/spec/fixtures/request_types.yml +13 -13
  253. data/spec/fixtures/resource_export_files.yml +1 -1
  254. data/spec/fixtures/resource_import_results.yml +2 -2
  255. data/spec/fixtures/roles.yml +22 -5
  256. data/spec/fixtures/shelves.yml +16 -16
  257. data/spec/fixtures/user_groups.yml +12 -12
  258. data/spec/fixtures/user_has_roles.yml +3 -4
  259. data/spec/fixtures/users.yml +0 -3
  260. data/spec/models/agent_relationship_type_spec.rb +8 -7
  261. data/spec/models/agent_type_spec.rb +8 -7
  262. data/spec/models/carrier_type_spec.rb +12 -11
  263. data/spec/models/content_type_spec.rb +8 -7
  264. data/spec/models/create_type_spec.rb +8 -7
  265. data/spec/models/doi_record_spec.rb +19 -0
  266. data/spec/models/form_of_work_spec.rb +8 -7
  267. data/spec/models/frequency_spec.rb +8 -7
  268. data/spec/models/item_spec.rb +0 -7
  269. data/spec/models/language_spec.rb +10 -9
  270. data/spec/models/license_spec.rb +8 -7
  271. data/spec/models/manifestation_relationship_type_spec.rb +8 -7
  272. data/spec/models/manifestation_spec.rb +81 -24
  273. data/spec/models/medium_of_performance_spec.rb +8 -7
  274. data/spec/models/periodical_and_manifestation_spec.rb +17 -0
  275. data/spec/models/periodical_spec.rb +16 -0
  276. data/spec/models/picture_file_spec.rb +2 -0
  277. data/spec/models/produce_type_spec.rb +8 -7
  278. data/spec/models/realize_type_spec.rb +8 -7
  279. data/spec/models/resource_export_file_spec.rb +9 -62
  280. data/spec/models/resource_import_file_spec.rb +14 -44
  281. data/spec/rails_helper.rb +8 -4
  282. data/spec/system/manifestations_spec.rb +0 -30
  283. data/spec/views/items/index.html.erb_spec.rb +6 -7
  284. data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
  285. data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -0
  286. data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.txt.erb_spec.rb} +1 -1
  287. data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.txt.erb_spec.rb} +2 -2
  288. data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
  289. metadata +560 -718
  290. data/app/controllers/item_custom_properties_controller.rb +0 -69
  291. data/app/controllers/manifestation_custom_properties_controller.rb +0 -69
  292. data/app/models/item_custom_property.rb +0 -18
  293. data/app/models/item_custom_value.rb +0 -17
  294. data/app/models/manifestation_custom_property.rb +0 -18
  295. data/app/models/manifestation_custom_value.rb +0 -17
  296. data/app/policies/item_custom_property_policy.rb +0 -21
  297. data/app/policies/manifestation_custom_property_policy.rb +0 -21
  298. data/app/views/agent_import_results/index.txt.ruby +0 -5
  299. data/app/views/item_custom_properties/_form.html.erb +0 -32
  300. data/app/views/item_custom_properties/edit.html.erb +0 -13
  301. data/app/views/item_custom_properties/index.html.erb +0 -43
  302. data/app/views/item_custom_properties/new.html.erb +0 -12
  303. data/app/views/item_custom_properties/show.html.erb +0 -28
  304. data/app/views/items/_item.json.jbuilder +0 -17
  305. data/app/views/items/index.json.jbuilder +0 -5
  306. data/app/views/items/show.json.jbuilder +0 -1
  307. data/app/views/manifestation_custom_properties/_form.html.erb +0 -32
  308. data/app/views/manifestation_custom_properties/edit.html.erb +0 -13
  309. data/app/views/manifestation_custom_properties/index.html.erb +0 -43
  310. data/app/views/manifestation_custom_properties/new.html.erb +0 -12
  311. data/app/views/manifestation_custom_properties/show.html.erb +0 -28
  312. data/app/views/manifestations/index.txt.ruby +0 -7
  313. data/app/views/manifestations/show.json.jbuilder +0 -2
  314. data/app/views/manifestations/show.txt.ruby +0 -5
  315. data/app/views/resource_import_results/index.txt.ruby +0 -5
  316. data/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  317. data/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  318. data/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  319. data/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  320. data/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  321. data/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  322. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agents.yml +0 -19
  323. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_import_custom_values.yml +0 -121
  324. data/spec/cassette_library/resource_import_results/index_txt_ruby/renders_a_list_of_resource_import_results.yml +0 -121
  325. data/spec/controllers/item_custom_properties_controller_spec.rb +0 -449
  326. data/spec/controllers/manifestation_custom_properties_controller_spec.rb +0 -449
  327. data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +0 -18
  328. data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +0 -17
  329. data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +0 -15
  330. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  331. data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
  332. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
  333. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
  334. data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +0 -5
  335. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  336. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  337. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
  338. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
  339. data/spec/factories/item_custom_property.rb +0 -6
  340. data/spec/factories/item_custom_value.rb +0 -6
  341. data/spec/factories/manifestation_custom_property.rb +0 -6
  342. data/spec/factories/manifestation_custom_value.rb +0 -6
  343. data/spec/fixtures/carrier_type_has_checkout_types.yml +0 -31
  344. data/spec/fixtures/checkout_stat_has_manifestations.yml +0 -24
  345. data/spec/fixtures/checkout_stat_has_users.yml +0 -24
  346. data/spec/fixtures/checkout_types.yml +0 -34
  347. data/spec/fixtures/circulation_statuses.yml +0 -136
  348. data/spec/fixtures/inventory_files.yml +0 -40
  349. data/spec/fixtures/item_custom_properties.yml +0 -24
  350. data/spec/fixtures/manifestation_checkout_stats.yml +0 -29
  351. data/spec/fixtures/manifestation_custom_properties.yml +0 -24
  352. data/spec/fixtures/manifestation_reserve_stats.yml +0 -29
  353. data/spec/fixtures/reserve_stat_has_manifestations.yml +0 -24
  354. data/spec/fixtures/reserve_stat_has_users.yml +0 -24
  355. data/spec/fixtures/reserve_transitions.yml +0 -104
  356. data/spec/fixtures/reserves.yml +0 -143
  357. data/spec/fixtures/use_restrictions.yml +0 -93
  358. data/spec/fixtures/user_checkout_stats.yml +0 -28
  359. data/spec/fixtures/user_group_has_checkout_types.yml +0 -111
  360. data/spec/fixtures/user_reserve_stats.yml +0 -28
  361. data/spec/models/item_custom_property_spec.rb +0 -18
  362. data/spec/models/item_custom_value_spec.rb +0 -17
  363. data/spec/models/manifestation_custom_property_spec.rb +0 -18
  364. data/spec/models/manifestation_custom_value_spec.rb +0 -17
  365. data/spec/requests/item_custom_properties_spec.rb +0 -129
  366. data/spec/requests/manifestation_custom_properties_spec.rb +0 -129
  367. data/spec/routing/item_custom_properties_routing_spec.rb +0 -38
  368. data/spec/routing/manifestation_custom_properties_routing_spec.rb +0 -38
  369. data/spec/system/items_spec.rb +0 -121
  370. data/spec/system/series_statements_spec.rb +0 -16
  371. data/spec/views/agent_import_results/index.html.erb_spec.rb +0 -29
  372. data/spec/views/agent_import_results/index.txt.ruby_spec.rb +0 -20
  373. data/spec/views/agent_import_results/show.html.erb_spec.rb +0 -24
  374. data/spec/views/item_custom_properties/edit.html.erb_spec.rb +0 -21
  375. data/spec/views/item_custom_properties/index.html.erb_spec.rb +0 -25
  376. data/spec/views/item_custom_properties/new.html.erb_spec.rb +0 -21
  377. data/spec/views/item_custom_properties/show.html.erb_spec.rb +0 -16
  378. data/spec/views/items/index.json.jbuilder_spec.rb +0 -15
  379. data/spec/views/items/show.json.jbuilder_spec.rb +0 -15
  380. data/spec/views/manifestation_custom_properties/edit.html.erb_spec.rb +0 -21
  381. data/spec/views/manifestation_custom_properties/index.html.erb_spec.rb +0 -25
  382. data/spec/views/manifestation_custom_properties/new.html.erb_spec.rb +0 -21
  383. data/spec/views/manifestation_custom_properties/show.html.erb_spec.rb +0 -16
  384. data/spec/views/manifestations/show.json.jbuilder_spec.rb +0 -16
  385. data/spec/views/resource_import_results/index.txt.ruby_spec.rb +0 -22
@@ -10,11 +10,12 @@ end
10
10
  #
11
11
  # Table name: realize_types
12
12
  #
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
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
  #
@@ -26,10 +26,10 @@ describe ResourceExportFile do
26
26
  expect(columns).to include "item_price"
27
27
  end
28
28
 
29
- it "should export custom identifier's value" do
29
+ it "should export NCID value" do
30
30
  manifestation = FactoryBot.create(:manifestation)
31
- custom = IdentifierType.find_by(name: "custom")
32
- identifier = FactoryBot.create(:identifier, identifier_type: custom, body: "a11223344")
31
+ ncid = IdentifierType.find_by(name: "ncid")
32
+ identifier = FactoryBot.create(:identifier, identifier_type: ncid, body: "BA91833159")
33
33
  export_file = ResourceExportFile.new
34
34
  export_file.user = users(:admin)
35
35
  export_file.save!
@@ -37,8 +37,8 @@ describe ResourceExportFile do
37
37
  file = export_file.resource_export
38
38
  expect(file).to be_truthy
39
39
  lines = File.open(file.path).readlines.map(&:chomp)
40
- expect(lines.first.split(/\t/)).to include "identifier:custom"
41
- expect(lines.last.split(/\t/)).to include "a11223344"
40
+ expect(lines.first.split(/\t/)).to include "ncid"
41
+ expect(lines.last.split(/\t/)).to include "BA91833159"
42
42
  end
43
43
 
44
44
  it "should export carrier_type" do
@@ -50,7 +50,9 @@ describe ResourceExportFile do
50
50
  export_file.save!
51
51
  export_file.export!
52
52
  file = export_file.resource_export
53
- CSV.open(file.path, {headers: true, col_sep: "\t"}).each do |row|
53
+ expect(file).to be_truthy
54
+ csv = CSV.open(file.path, {headers: true, col_sep: "\t"})
55
+ csv.each do |row|
54
56
  expect(row).to have_key "carrier_type"
55
57
  case row["manifestation_id"].to_i
56
58
  when 1
@@ -60,61 +62,6 @@ describe ResourceExportFile do
60
62
  end
61
63
  end
62
64
  end
63
-
64
- it "should export create_type, realize_type and produce_type" do
65
- export_file = ResourceExportFile.new
66
- export_file.user = users(:admin)
67
- export_file.save!
68
- export_file.export!
69
- file = export_file.resource_export
70
- CSV.open(file.path, {headers: true, col_sep: "\t"}).each do |row|
71
- manifestation = Manifestation.find(row['manifestation_id'])
72
- manifestation.creates.each do |create|
73
- if create.create_type
74
- expect(row['creator']).to match "#{create.agent.full_name}||#{create.create_type.name}"
75
- end
76
- end
77
-
78
- manifestation.realizes.each do |realize|
79
- if realize.realize_type
80
- expect(row['contributor']).to match "#{realize.agent.full_name}||#{realize.realize_type.name}"
81
- end
82
- end
83
-
84
- manifestation.produces.each do |produce|
85
- if produce.produce_type
86
- expect(row['publisher']).to match "#{produce.agent.full_name}||#{produce.produce_type.name}"
87
- end
88
- end
89
- end
90
- end
91
-
92
- it "should export custom properties" do
93
- item = FactoryBot.create(:item)
94
- 3.times do
95
- item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value)
96
- end
97
- 3.times do
98
- item.item_custom_values << FactoryBot.build(:item_custom_value)
99
- end
100
- export_file = ResourceExportFile.new
101
- export_file.user = users(:admin)
102
- export_file.save!
103
- export_file.export!
104
- file = export_file.resource_export
105
- CSV.open(file.path, {headers: true, col_sep: "\t"}).each do |row|
106
- if row['manifestation_id'] == item.manifestation.id
107
- item.manifestation_custom_values.each do |value|
108
- expect(row).to have_key "manifestation:#{value.manifestation_custom_property.name}"
109
- expect(row["manifestation:#{value.manifestation_custom_property.name}"]).to eq value
110
- end
111
- item.item_custom_values.each do |value|
112
- expect(row).to have_key "item:#{value.item_custom_property.name}"
113
- expect(row["item:#{value.item_custom_property.name}"]).to eq value
114
- end
115
- end
116
- end
117
- end
118
65
  end
119
66
 
120
67
  # == Schema Information
@@ -125,7 +72,7 @@ end
125
72
  # user_id :integer
126
73
  # resource_export_file_name :string
127
74
  # resource_export_content_type :string
128
- # resource_export_file_size :integer
75
+ # resource_export_file_size :bigint
129
76
  # resource_export_updated_at :datetime
130
77
  # executed_at :datetime
131
78
  # created_at :datetime
@@ -9,8 +9,7 @@ describe ResourceImportFile do
9
9
  @file = ResourceImportFile.create(
10
10
  resource_import: File.new("#{Rails.root}/../../examples/resource_import_file_sample1.tsv"),
11
11
  default_shelf_id: 3,
12
- user: users(:admin),
13
- edit_mode: 'create'
12
+ user: users(:admin)
14
13
  )
15
14
  end
16
15
 
@@ -30,7 +29,7 @@ describe ResourceImportFile do
30
29
  Manifestation.count.should eq old_manifestations_count + 10
31
30
  Item.count.should eq old_items_count + 10
32
31
  Agent.count.should eq old_agents_count + 9
33
- @file.resource_import_results.order(:id).first.body.split("\t").first.should eq 'imported_manifestation_id'
32
+ @file.resource_import_results.order(:id).first.body.split("\t").first.should eq 'manifestation_identifier'
34
33
  ResourceImportResult.count.should eq old_import_results_count + 23
35
34
 
36
35
  manifestation_101 = Manifestation.find_by(manifestation_identifier: '101')
@@ -157,16 +156,6 @@ describe ResourceImportFile do
157
156
  expect(manifestation.identifier_contents(:isbn)).to include("9784840239219")
158
157
  expect(manifestation.identifier_contents(:isbn)).to include("9784043898039")
159
158
  end
160
-
161
- it "should import custom values", vcr: true do
162
- @file.import_start
163
- item_10102 = Item.find_by(item_identifier: '10102')
164
- expect(item_10102.manifestation.manifestation_custom_values.pluck(:value)).to eq ['カスタム項目テスト1', 'カスタム項目テスト2']
165
- expect(item_10102.item_custom_values.pluck(:value)).to eq []
166
- item_10103 = Item.find_by(item_identifier: '10103')
167
- expect(item_10103.manifestation.manifestation_custom_values.pluck(:value)).to eq ["カスタム項目テスト1", "カスタム項目テスト2"]
168
- expect(item_10103.item_custom_values.pluck(:value)).to eq ['カスタム項目テスト3', 'カスタム項目テスト4']
169
- end
170
159
  end
171
160
 
172
161
  describe "ISBN import" do
@@ -227,15 +216,15 @@ describe ResourceImportFile do
227
216
  old_items_count = Item.count
228
217
  old_agents_count = Agent.count
229
218
  old_import_results_count = ResourceImportResult.count
230
- @file.import_start.should eq({manifestation_imported: 10, item_imported: 10, manifestation_found: 6, item_found: 3, failed: 7})
219
+ @file.import_start.should eq({manifestation_imported: 9, item_imported: 8, manifestation_found: 5, item_found: 3, failed: 7})
231
220
  manifestation = Item.find_by(item_identifier: '11111').manifestation
232
221
  manifestation.publishers.first.full_name.should eq 'test4'
233
222
  manifestation.publishers.first.full_name_transcription.should eq 'てすと4'
234
223
  manifestation.publishers.second.full_name_transcription.should eq 'てすと5'
235
- Manifestation.count.should eq old_manifestations_count + 10
236
- Item.count.should eq old_items_count + 10
224
+ Manifestation.count.should eq old_manifestations_count + 9
225
+ Item.count.should eq old_items_count + 8
237
226
  Agent.count.should eq old_agents_count + 9
238
- ResourceImportResult.count.should eq old_import_results_count + 23
227
+ ResourceImportResult.count.should eq old_import_results_count + 21
239
228
  Item.find_by(item_identifier: '10101').manifestation.creators.size.should eq 2
240
229
  Item.find_by(item_identifier: '10101').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
241
230
  Item.find_by(item_identifier: '10102').manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
@@ -346,28 +335,20 @@ resource_import_file_test_description test\\ntest test\\ntest test_description t
346
335
  expect(manifestation.items.first.note).to eq "test\ntest"
347
336
  end
348
337
  end
349
-
350
- describe "when it contains custom properties" do
351
- xit "should be imported" do
352
- end
353
- end
354
338
  end
355
339
 
356
340
  describe "when its mode is 'update'" do
357
- before(:each) do
358
- @file = ResourceImportFile.create!(
341
+ it "should update items", vcr: true do
342
+ file = ResourceImportFile.create!(
359
343
  resource_import: File.new("#{Rails.root}/../../examples/item_update_file.tsv"),
360
344
  user: users(:admin),
361
345
  edit_mode: 'update'
362
346
  )
363
- end
364
-
365
- it "should update items", vcr: true do
366
- @file.modify
367
- expect(@file.resource_import_results.first).to be_truthy
368
- expect(@file.resource_import_results.first.body).to match /item_identifier/
347
+ file.modify
348
+ expect(file.resource_import_results.first).to be_truthy
349
+ expect(file.resource_import_results.first.body).to match /item_identifier/
369
350
  item_00001 = Item.find_by(item_identifier: '00001')
370
- item_00001.manifestation.creators.order('agents.id').pluck(:full_name).should eq ['たなべ', 'こうすけ']
351
+ item_00001.manifestation.creators.order('agents.id').collect(&:full_name).should eq ['たなべ', 'こうすけ']
371
352
  item_00001.binding_item_identifier.should eq '900001'
372
353
  item_00001.binding_call_number.should eq '336|A'
373
354
  item_00001.binded_at.should eq Time.zone.parse('2014-08-16')
@@ -380,18 +361,7 @@ resource_import_file_test_description test\\ntest test\\ntest test_description t
380
361
  item_00003.include_supplements.should be_truthy
381
362
 
382
363
  Item.find_by(item_identifier: '00004').include_supplements.should be_falsy
383
-
384
- item_00025 = Item.find_by(item_identifier: '00025')
385
- expect(item_00025.manifestation.original_title).to eq "テスト4"
386
- expect(item_00025.manifestation.subjects.pluck(:term)).to eq ['test2', 'test3']
387
- expect(item_00025.call_number).to eq "547|ヤ"
388
- end
389
-
390
- it "should update custom values", vcr: true do
391
- @file.import_start
392
- item_00001 = Item.find_by(item_identifier: '00001')
393
- expect(item_00001.manifestation.manifestation_custom_values.pluck(:manifestation_custom_property_id, :value)).to eq [[2, "カスタム項目5"]]
394
- expect(item_00001.item_custom_values.order(:item_custom_property_id).first.value).to eq "カスタム項目6"
364
+ Item.find_by(item_identifier: '00025').call_number.should eq "547|ヤ"
395
365
  end
396
366
 
397
367
  # it "should update series_statement", vcr: true do
@@ -426,7 +396,7 @@ resource_import_file_test_description test\\ntest test\\ntest test_description t
426
396
  edit_mode: 'destroy'
427
397
  )
428
398
  file.remove
429
- Item.count.should eq old_count - 10
399
+ Item.count.should eq old_count - 11
430
400
  end
431
401
  end
432
402
 
data/spec/rails_helper.rb CHANGED
@@ -1,7 +1,11 @@
1
1
  require 'simplecov'
2
2
  require 'coveralls'
3
+
4
+ SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
7
+ ])
3
8
  SimpleCov.start 'rails'
4
- Coveralls.wear!
5
9
 
6
10
  # This file is copied to spec/ when you run 'rails generate rspec:install'
7
11
  ENV['RAILS_ENV'] ||= 'test'
@@ -12,7 +16,7 @@ require 'spec_helper'
12
16
  require 'rspec/rails'
13
17
  # Add additional requires below this line. Rails is not loaded until this point!
14
18
  require 'vcr'
15
- require 'factory_bot_rails'
19
+ require 'factory_bot'
16
20
  require 'rspec/active_model/mocks'
17
21
  require 'pundit/rspec'
18
22
  require "capybara/rspec"
@@ -70,5 +74,5 @@ RSpec.configure do |config|
70
74
  end
71
75
  end
72
76
 
73
- #FactoryBot.definition_file_paths << "#{::Rails.root}/../../spec/factories"
74
- #FactoryBot.find_definitions
77
+ FactoryBot.definition_file_paths << "#{::Rails.root}/../../spec/factories"
78
+ FactoryBot.find_definitions
@@ -18,18 +18,6 @@ RSpec.describe 'Manifestations', type: :system do
18
18
  visit manifestation_path(@item.manifestation.id, locale: :ja)
19
19
  expect(page).to have_content @item.item_identifier
20
20
  end
21
-
22
- it 'should show memo' do
23
- @item.manifestation.update(memo: 'memo')
24
- visit manifestation_path(@item.manifestation.id, locale: :ja)
25
- expect(page).to have_content @item.manifestation.memo
26
- end
27
-
28
- it 'should show custom properties' do
29
- @item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value)
30
- visit manifestation_path(@item.manifestation.id, locale: :ja)
31
- expect(page).to have_content @item.manifestation.manifestation_custom_values.first.value
32
- end
33
21
  end
34
22
 
35
23
  describe 'When logged in as User' do
@@ -41,18 +29,6 @@ RSpec.describe 'Manifestations', type: :system do
41
29
  visit manifestation_path(@item.manifestation.id, locale: :ja)
42
30
  expect(page).to have_content @item.item_identifier
43
31
  end
44
-
45
- it 'should not show memo' do
46
- @item.manifestation.update(memo: 'memo')
47
- visit manifestation_path(@item.manifestation.id, locale: :ja)
48
- expect(page).not_to have_content @item.manifestation.memo
49
- end
50
-
51
- it 'should not show custom properties' do
52
- @item.manifestation.manifestation_custom_values << FactoryBot.build(:manifestation_custom_value)
53
- visit manifestation_path(@item.manifestation.id, locale: :ja)
54
- expect(page).not_to have_content @item.manifestation.manifestation_custom_values.first.value
55
- end
56
32
  end
57
33
 
58
34
  describe 'When not logged in' do
@@ -60,11 +36,5 @@ RSpec.describe 'Manifestations', type: :system do
60
36
  visit manifestation_path(@item.manifestation.id, locale: :ja)
61
37
  expect(page).to have_content @item.item_identifier
62
38
  end
63
-
64
- it 'should not show memo' do
65
- @item.manifestation.update(memo: 'memo')
66
- visit manifestation_path(@item.manifestation.id, locale: :ja)
67
- expect(page).not_to have_content @item.manifestation.memo
68
- end
69
39
  end
70
40
  end
@@ -8,19 +8,18 @@ describe "items/index" do
8
8
  FactoryBot.create(:item),
9
9
  ], total_count: 1).page(1)
10
10
  )
11
- facet1 = double("Facet for available on shelf")
12
- allow(facet1).to receive(:count).and_return(1)
13
- allow(facet1).to receive(:value).and_return("Available On Shelf")
14
- @circulation_status_facet = assign(:circulation_status_facet, [facet1])
15
11
  user = FactoryBot.create(:librarian)
16
12
  allow(view).to receive(:policy) do |record|
17
13
  Pundit.policy(user, record)
18
14
  end
19
15
  end
20
16
 
21
- it "renders a list of realizes" do
22
- allow(view).to receive(:policy).and_return double(create?: true, destroy?: true)
23
- render
17
+ describe "item index" do
18
+ it "should render index" do
19
+ view.stub(:filtered_params).and_return(ActionController::Parameters.new().permit)
20
+ render
21
+ expect(rendered).to have_selector "div#submenu ul"
22
+ end
24
23
  end
25
24
  end
26
25
 
@@ -12,11 +12,11 @@ describe "manifestations/index" do
12
12
  @reservable_facet = @carrier_type_facet = @language_facet = @library_facet = @pub_year_facet = []
13
13
  @seconds = 0
14
14
  @max_number_of_results = 500
15
+ view.stub(:filtered_params).and_return(ActionController::Parameters.new(per_page: 50).permit(:per_page))
15
16
  end
16
17
 
17
18
  describe "sort_by menu" do
18
19
  it "should reflect per_page params for views" do
19
- params[:per_page] = 50
20
20
  render
21
21
  expect(rendered).to have_selector "select#per_page option[value='50'][selected='selected']"
22
22
  end
@@ -5,6 +5,7 @@ describe "manifestations/index.rdf.builder" do
5
5
  manifestation = FactoryBot.create(:manifestation)
6
6
  @manifestations = assign(:manifestations, [manifestation] )
7
7
  @library_group = LibraryGroup.first
8
+ view.stub(:filtered_params).and_return(ActionController::Parameters.new(per_page: 50).permit([:per_page]))
8
9
  end
9
10
 
10
11
  it "should export RDF format" do
@@ -1,6 +1,6 @@
1
1
  require "rails_helper.rb"
2
2
 
3
- describe "manifestations/index.txt.ruby" do
3
+ describe "manifestations/index.txt.erb" do
4
4
  before(:each) do
5
5
  manifestation = FactoryBot.create(:manifestation)
6
6
  manifestation.items << FactoryBot.create(:item, bookstore_id: 1, budget_type_id: 1, price: 100)
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- describe "manifestations/show.txt.ruby" do
3
+ describe "manifestations/show.txt.erb" do
4
4
  fixtures :all
5
5
 
6
6
  before(:each) do
@@ -11,6 +11,6 @@ describe "manifestations/show.txt.ruby" do
11
11
  allow(view).to receive(:policy).and_return double(create?: true)
12
12
  render
13
13
  # Run the generator again with the --webrat flag if you want to use webrat matchers
14
- rendered.should match(/text/)
14
+ rendered.should match(/1/)
15
15
  end
16
16
  end
@@ -19,6 +19,6 @@ describe "resource_import_results/show" do
19
19
  @resource_import_result.resource_import_file.delete
20
20
  @resource_import_result.resource_import_file = nil
21
21
  render
22
- expect(rendered).to match /original_title/
22
+ expect(rendered).to match /MyText/
23
23
  end
24
24
  end