enju_biblio 0.3.12 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (373) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/content_types_controller.rb +1 -1
  4. data/app/controllers/items_controller.rb +4 -18
  5. data/app/controllers/manifestations_controller.rb +67 -58
  6. data/app/controllers/resource_import_results_controller.rb +2 -6
  7. data/app/helpers/enju_biblio/application_helper.rb +5 -5
  8. data/app/helpers/manifestations_helper.rb +10 -10
  9. data/app/models/agent.rb +3 -3
  10. data/app/models/agent_import_file.rb +1 -1
  11. data/app/models/agent_relationship_type.rb +8 -7
  12. data/app/models/agent_type.rb +10 -7
  13. data/app/models/carrier_type.rb +14 -11
  14. data/app/models/content_type.rb +10 -7
  15. data/app/models/create_type.rb +8 -7
  16. data/app/models/doi_record.rb +36 -0
  17. data/app/models/form_of_work.rb +11 -8
  18. data/app/models/frequency.rb +10 -7
  19. data/app/models/identifier_type.rb +1 -0
  20. data/app/models/import_request.rb +0 -2
  21. data/app/models/isbn_record.rb +51 -0
  22. data/app/models/isbn_record_and_manifestation.rb +18 -0
  23. data/app/models/issn_record.rb +49 -0
  24. data/app/models/issn_record_and_manifestation.rb +18 -0
  25. data/app/models/item.rb +2 -50
  26. data/app/models/language.rb +10 -9
  27. data/app/models/license.rb +9 -7
  28. data/app/models/manifestation.rb +252 -148
  29. data/app/models/manifestation_relationship_type.rb +9 -7
  30. data/app/models/medium_of_performance.rb +11 -8
  31. data/app/models/periodical.rb +33 -0
  32. data/app/models/periodical_and_manifestation.rb +16 -0
  33. data/app/models/picture_file.rb +2 -0
  34. data/app/models/produce_type.rb +8 -7
  35. data/app/models/realize_type.rb +8 -7
  36. data/app/models/resource_export_file.rb +8 -6
  37. data/app/models/resource_export_file_state_machine.rb +1 -1
  38. data/app/models/resource_import_file.rb +62 -153
  39. data/app/views/agent_import_results/index.txt.erb +3 -0
  40. data/app/views/agent_relationship_types/index.html.erb +1 -1
  41. data/app/views/agent_relationship_types/show.html.erb +1 -1
  42. data/app/views/agent_relationships/_form.html.erb +1 -1
  43. data/app/views/agent_types/index.html.erb +1 -1
  44. data/app/views/agent_types/show.html.erb +1 -1
  45. data/app/views/agents/_agent.html.erb +1 -1
  46. data/app/views/agents/_agent_list.html.erb +2 -2
  47. data/app/views/agents/_form.html.erb +4 -4
  48. data/app/views/agents/_index_agent.html.erb +1 -1
  49. data/app/views/agents/_index_agent_merge_list.html.erb +1 -1
  50. data/app/views/agents/_index_expression.html.erb +2 -2
  51. data/app/views/agents/_index_manifestation.html.erb +2 -2
  52. data/app/views/agents/_index_work.html.erb +2 -2
  53. data/app/views/agents/index.atom.builder +1 -1
  54. data/app/views/agents/index.rss.builder +1 -1
  55. data/app/views/agents/show.html+phone.erb +2 -2
  56. data/app/views/agents/show.html.erb +2 -2
  57. data/app/views/carrier_types/index.html.erb +2 -2
  58. data/app/views/carrier_types/show.html.erb +3 -3
  59. data/app/views/content_types/index.html.erb +1 -1
  60. data/app/views/content_types/show.html.erb +1 -1
  61. data/app/views/countries/index.html.erb +1 -1
  62. data/app/views/countries/show.html.erb +1 -1
  63. data/app/views/create_types/index.html.erb +1 -1
  64. data/app/views/create_types/show.html.erb +1 -1
  65. data/app/views/creates/_form.html.erb +1 -1
  66. data/app/views/form_of_works/index.html.erb +1 -1
  67. data/app/views/form_of_works/show.html.erb +1 -1
  68. data/app/views/frequencies/index.html.erb +1 -1
  69. data/app/views/frequencies/show.html.erb +1 -1
  70. data/app/views/identifier_types/index.html.erb +1 -1
  71. data/app/views/identifier_types/show.html.erb +1 -1
  72. data/app/views/items/_form.html.erb +13 -33
  73. data/app/views/items/index.html+phone.erb +3 -3
  74. data/app/views/items/index.html.erb +3 -3
  75. data/app/views/items/show.html+phone.erb +5 -5
  76. data/app/views/items/show.html.erb +12 -27
  77. data/app/views/languages/index.html.erb +1 -1
  78. data/app/views/languages/show.html.erb +1 -1
  79. data/app/views/layouts/agents.html.erb +2 -2
  80. data/app/views/layouts/items.html.erb +1 -1
  81. data/app/views/layouts/manifestations.html.erb +4 -4
  82. data/app/views/licenses/index.html.erb +1 -1
  83. data/app/views/licenses/show.html.erb +1 -1
  84. data/app/views/manifestation_relationship_types/index.html.erb +1 -1
  85. data/app/views/manifestation_relationship_types/show.html.erb +1 -1
  86. data/app/views/manifestation_relationships/_form.html.erb +1 -1
  87. data/app/views/manifestations/_call_number.html.erb +3 -3
  88. data/app/views/manifestations/_export_detail.html.erb +0 -1
  89. data/app/views/manifestations/_export_list.html.erb +0 -1
  90. data/app/views/manifestations/_form.html.erb +5 -28
  91. data/app/views/manifestations/_identifier_fields.html.erb +1 -1
  92. data/app/views/manifestations/_manifestation.txt.erb +1 -1
  93. data/app/views/manifestations/_show_creators.html.erb +1 -1
  94. data/app/views/manifestations/_show_detail_librarian.html.erb +5 -25
  95. data/app/views/manifestations/_show_detail_user.html.erb +5 -13
  96. data/app/views/manifestations/_show_holding.html+phone.erb +3 -3
  97. data/app/views/manifestations/_show_holding.html.erb +2 -2
  98. data/app/views/manifestations/explain.sru +9 -0
  99. data/app/views/manifestations/index.atom.builder +1 -1
  100. data/app/views/manifestations/index.opds.builder +1 -1
  101. data/app/views/manifestations/index.rdf.builder +1 -1
  102. data/app/views/manifestations/index.rss.builder +1 -1
  103. data/app/views/manifestations/index.sru.builder +101 -0
  104. data/app/views/manifestations/index.txt.erb +1 -0
  105. data/app/views/manifestations/show.txt.erb +1 -0
  106. data/app/views/medium_of_performances/index.html.erb +1 -1
  107. data/app/views/medium_of_performances/show.html.erb +1 -1
  108. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  109. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  110. data/app/views/picture_files/edit.html.erb +0 -4
  111. data/app/views/produce_types/index.html.erb +1 -1
  112. data/app/views/produce_types/show.html.erb +1 -1
  113. data/app/views/produces/_form.html.erb +1 -1
  114. data/app/views/realize_types/index.html.erb +1 -1
  115. data/app/views/realize_types/show.html.erb +1 -1
  116. data/app/views/realizes/_form.html.erb +1 -1
  117. data/app/views/resource_import_files/_results.html.erb +0 -6
  118. data/app/views/resource_import_files/new.html.erb +2 -2
  119. data/app/views/resource_import_results/index.html.erb +11 -0
  120. data/app/views/resource_import_results/index.txt.erb +3 -0
  121. data/app/views/series_statements/_form.html.erb +8 -6
  122. data/app/views/series_statements/show.html.erb +0 -12
  123. data/config/locales/translation_en.yml +1 -28
  124. data/config/locales/translation_ja.yml +3 -30
  125. data/config/routes.rb +0 -2
  126. data/db/migrate/20081027150907_create_picture_files.rb +2 -0
  127. data/db/migrate/20160319144230_create_issn_records.rb +11 -0
  128. data/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  129. data/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  130. data/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  131. data/db/migrate/20190102034126_create_doi_records.rb +13 -0
  132. data/db/migrate/20190311154610_create_periodicals.rb +10 -0
  133. data/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
  134. data/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  135. data/lib/enju_biblio.rb +2 -0
  136. data/lib/enju_biblio/openurl.rb +1 -5
  137. data/lib/enju_biblio/porta_cql.rb +282 -0
  138. data/lib/enju_biblio/sru.rb +83 -0
  139. data/lib/enju_biblio/version.rb +1 -1
  140. data/lib/generators/enju_biblio/setup/setup_generator.rb +0 -2
  141. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_relationship_types.yml +3 -3
  142. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_types.yml +2 -4
  143. data/lib/generators/enju_biblio/setup/templates/db/fixtures/carrier_types.yml +8 -26
  144. data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +12 -24
  145. data/lib/generators/enju_biblio/setup/templates/db/fixtures/create_types.yml +4 -22
  146. data/lib/generators/enju_biblio/setup/templates/db/fixtures/form_of_works.yml +1 -1
  147. data/lib/generators/enju_biblio/setup/templates/db/fixtures/frequencies.yml +9 -18
  148. data/lib/generators/enju_biblio/setup/templates/db/fixtures/languages.yml +2 -4
  149. data/lib/generators/enju_biblio/setup/templates/db/fixtures/licenses.yml +2 -2
  150. data/lib/generators/enju_biblio/setup/templates/db/fixtures/manifestation_relationship_types.yml +2 -4
  151. data/lib/generators/enju_biblio/setup/templates/db/fixtures/medium_of_performances.yml +15 -0
  152. data/lib/generators/enju_biblio/setup/templates/db/fixtures/produce_types.yml +2 -19
  153. data/lib/generators/enju_biblio/setup/templates/db/fixtures/realize_types.yml +3 -21
  154. 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
  155. data/spec/controllers/content_types_controller_spec.rb +1 -1
  156. data/spec/controllers/items_controller_spec.rb +1 -59
  157. data/spec/controllers/manifestations_controller_spec.rb +19 -49
  158. data/spec/dummy/app/helpers/application_helper.rb +1 -1
  159. data/spec/dummy/app/models/user.rb +4 -0
  160. data/spec/dummy/bin/bundle +1 -1
  161. data/spec/dummy/bin/setup +1 -3
  162. data/spec/dummy/bin/update +4 -2
  163. data/spec/dummy/bin/yarn +3 -3
  164. data/spec/dummy/config/application.rb +1 -2
  165. data/spec/dummy/config/database.yml +70 -9
  166. data/spec/dummy/config/initializers/assets.rb +2 -2
  167. data/spec/dummy/db/development.sqlite3 +0 -0
  168. data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -0
  169. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  170. data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
  171. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
  172. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  173. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  174. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  175. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -0
  176. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
  177. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
  178. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
  179. data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
  180. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  181. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  182. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
  183. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  184. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  185. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  186. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  187. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  188. data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
  189. data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
  190. data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
  191. data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
  192. data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
  193. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
  194. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
  195. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  196. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  197. data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
  198. data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
  199. data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
  200. data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
  201. data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
  202. data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
  203. data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
  204. data/spec/dummy/db/migrate/20180709161346_add_created_at_to_tag.rb +6 -0
  205. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  206. data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
  207. data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
  208. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  209. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  210. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  211. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  212. data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  213. data/spec/dummy/db/schema.rb +335 -221
  214. data/spec/dummy/db/test.sqlite3 +0 -0
  215. data/spec/factories/create_types.rb +8 -7
  216. data/spec/factories/produce_types.rb +8 -7
  217. data/spec/factories/realize_types.rb +8 -7
  218. data/spec/factories/series_statement.rb +3 -4
  219. data/spec/fixtures/agent_relationship_types.yml +8 -7
  220. data/spec/fixtures/agent_types.yml +11 -10
  221. data/spec/fixtures/carrier_types.yml +16 -15
  222. data/spec/fixtures/content_types.yml +20 -31
  223. data/spec/fixtures/create_types.yml +12 -15
  224. data/spec/fixtures/creates.yml +0 -2
  225. data/spec/fixtures/form_of_works.yml +11 -10
  226. data/spec/fixtures/frequencies.yml +17 -25
  227. data/spec/fixtures/items.yml +11 -12
  228. data/spec/fixtures/languages.yml +11 -11
  229. data/spec/fixtures/libraries.yml +30 -30
  230. data/spec/fixtures/library_groups.yml +11 -6
  231. data/spec/fixtures/licenses.yml +8 -7
  232. data/spec/fixtures/manifestation_relationship_types.yml +12 -11
  233. data/spec/fixtures/manifestations.yml +0 -1
  234. data/spec/fixtures/medium_of_performances.yml +10 -9
  235. data/spec/fixtures/picture_files.yml +2 -0
  236. data/spec/fixtures/produce_types.yml +10 -11
  237. data/spec/fixtures/produces.yml +0 -2
  238. data/spec/fixtures/profiles.yml +8 -5
  239. data/spec/fixtures/realize_types.yml +11 -13
  240. data/spec/fixtures/realizes.yml +0 -2
  241. data/spec/fixtures/request_status_types.yml +14 -14
  242. data/spec/fixtures/request_types.yml +13 -13
  243. data/spec/fixtures/resource_export_files.yml +1 -1
  244. data/spec/fixtures/resource_import_results.yml +2 -2
  245. data/spec/fixtures/roles.yml +22 -5
  246. data/spec/fixtures/shelves.yml +16 -16
  247. data/spec/fixtures/user_groups.yml +12 -12
  248. data/spec/fixtures/user_has_roles.yml +3 -4
  249. data/spec/fixtures/users.yml +0 -3
  250. data/spec/models/agent_relationship_type_spec.rb +8 -7
  251. data/spec/models/agent_type_spec.rb +8 -7
  252. data/spec/models/carrier_type_spec.rb +12 -11
  253. data/spec/models/content_type_spec.rb +8 -7
  254. data/spec/models/create_type_spec.rb +8 -7
  255. data/spec/models/doi_record_spec.rb +19 -0
  256. data/spec/models/form_of_work_spec.rb +8 -7
  257. data/spec/models/frequency_spec.rb +8 -7
  258. data/spec/models/item_spec.rb +0 -7
  259. data/spec/models/language_spec.rb +10 -9
  260. data/spec/models/license_spec.rb +8 -7
  261. data/spec/models/manifestation_relationship_type_spec.rb +8 -7
  262. data/spec/models/manifestation_spec.rb +81 -24
  263. data/spec/models/medium_of_performance_spec.rb +8 -7
  264. data/spec/models/periodical_and_manifestation_spec.rb +17 -0
  265. data/spec/models/periodical_spec.rb +16 -0
  266. data/spec/models/picture_file_spec.rb +2 -0
  267. data/spec/models/produce_type_spec.rb +8 -7
  268. data/spec/models/realize_type_spec.rb +8 -7
  269. data/spec/models/resource_export_file_spec.rb +9 -62
  270. data/spec/models/resource_import_file_spec.rb +14 -44
  271. data/spec/rails_helper.rb +8 -4
  272. data/spec/system/manifestations_spec.rb +0 -30
  273. data/spec/views/items/index.html.erb_spec.rb +6 -7
  274. data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.txt.erb_spec.rb} +1 -1
  275. data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.txt.erb_spec.rb} +2 -2
  276. data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
  277. metadata +567 -725
  278. data/app/controllers/item_custom_properties_controller.rb +0 -69
  279. data/app/controllers/manifestation_custom_properties_controller.rb +0 -69
  280. data/app/models/item_custom_property.rb +0 -18
  281. data/app/models/item_custom_value.rb +0 -17
  282. data/app/models/manifestation_custom_property.rb +0 -18
  283. data/app/models/manifestation_custom_value.rb +0 -17
  284. data/app/policies/item_custom_property_policy.rb +0 -21
  285. data/app/policies/manifestation_custom_property_policy.rb +0 -21
  286. data/app/views/agent_import_results/index.txt.ruby +0 -5
  287. data/app/views/item_custom_properties/_form.html.erb +0 -32
  288. data/app/views/item_custom_properties/edit.html.erb +0 -13
  289. data/app/views/item_custom_properties/index.html.erb +0 -43
  290. data/app/views/item_custom_properties/new.html.erb +0 -12
  291. data/app/views/item_custom_properties/show.html.erb +0 -28
  292. data/app/views/items/_item.json.jbuilder +0 -17
  293. data/app/views/items/index.json.jbuilder +0 -5
  294. data/app/views/items/show.json.jbuilder +0 -1
  295. data/app/views/manifestation_custom_properties/_form.html.erb +0 -32
  296. data/app/views/manifestation_custom_properties/edit.html.erb +0 -13
  297. data/app/views/manifestation_custom_properties/index.html.erb +0 -43
  298. data/app/views/manifestation_custom_properties/new.html.erb +0 -12
  299. data/app/views/manifestation_custom_properties/show.html.erb +0 -28
  300. data/app/views/manifestations/index.txt.ruby +0 -7
  301. data/app/views/manifestations/show.json.jbuilder +0 -2
  302. data/app/views/manifestations/show.txt.ruby +0 -5
  303. data/app/views/resource_import_results/index.txt.ruby +0 -5
  304. data/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  305. data/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  306. data/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  307. data/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  308. data/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  309. data/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  310. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agents.yml +0 -19
  311. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_import_custom_values.yml +0 -121
  312. data/spec/cassette_library/resource_import_results/index_txt_ruby/renders_a_list_of_resource_import_results.yml +0 -121
  313. data/spec/controllers/item_custom_properties_controller_spec.rb +0 -449
  314. data/spec/controllers/manifestation_custom_properties_controller_spec.rb +0 -449
  315. data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +0 -18
  316. data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +0 -17
  317. data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +0 -15
  318. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  319. data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
  320. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
  321. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
  322. data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +0 -5
  323. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  324. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  325. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
  326. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
  327. data/spec/factories/item_custom_property.rb +0 -6
  328. data/spec/factories/item_custom_value.rb +0 -6
  329. data/spec/factories/manifestation_custom_property.rb +0 -6
  330. data/spec/factories/manifestation_custom_value.rb +0 -6
  331. data/spec/fixtures/carrier_type_has_checkout_types.yml +0 -31
  332. data/spec/fixtures/checkout_stat_has_manifestations.yml +0 -24
  333. data/spec/fixtures/checkout_stat_has_users.yml +0 -24
  334. data/spec/fixtures/checkout_types.yml +0 -34
  335. data/spec/fixtures/circulation_statuses.yml +0 -136
  336. data/spec/fixtures/inventory_files.yml +0 -40
  337. data/spec/fixtures/item_custom_properties.yml +0 -24
  338. data/spec/fixtures/manifestation_checkout_stats.yml +0 -29
  339. data/spec/fixtures/manifestation_custom_properties.yml +0 -24
  340. data/spec/fixtures/manifestation_reserve_stats.yml +0 -29
  341. data/spec/fixtures/reserve_stat_has_manifestations.yml +0 -24
  342. data/spec/fixtures/reserve_stat_has_users.yml +0 -24
  343. data/spec/fixtures/reserve_transitions.yml +0 -104
  344. data/spec/fixtures/reserves.yml +0 -143
  345. data/spec/fixtures/use_restrictions.yml +0 -93
  346. data/spec/fixtures/user_checkout_stats.yml +0 -28
  347. data/spec/fixtures/user_group_has_checkout_types.yml +0 -111
  348. data/spec/fixtures/user_reserve_stats.yml +0 -28
  349. data/spec/models/item_custom_property_spec.rb +0 -18
  350. data/spec/models/item_custom_value_spec.rb +0 -17
  351. data/spec/models/manifestation_custom_property_spec.rb +0 -18
  352. data/spec/models/manifestation_custom_value_spec.rb +0 -17
  353. data/spec/requests/item_custom_properties_spec.rb +0 -129
  354. data/spec/requests/manifestation_custom_properties_spec.rb +0 -129
  355. data/spec/routing/item_custom_properties_routing_spec.rb +0 -38
  356. data/spec/routing/manifestation_custom_properties_routing_spec.rb +0 -38
  357. data/spec/system/items_spec.rb +0 -115
  358. data/spec/system/series_statements_spec.rb +0 -16
  359. data/spec/views/agent_import_results/index.html.erb_spec.rb +0 -29
  360. data/spec/views/agent_import_results/index.txt.ruby_spec.rb +0 -20
  361. data/spec/views/agent_import_results/show.html.erb_spec.rb +0 -24
  362. data/spec/views/item_custom_properties/edit.html.erb_spec.rb +0 -21
  363. data/spec/views/item_custom_properties/index.html.erb_spec.rb +0 -25
  364. data/spec/views/item_custom_properties/new.html.erb_spec.rb +0 -21
  365. data/spec/views/item_custom_properties/show.html.erb_spec.rb +0 -16
  366. data/spec/views/items/index.json.jbuilder_spec.rb +0 -15
  367. data/spec/views/items/show.json.jbuilder_spec.rb +0 -15
  368. data/spec/views/manifestation_custom_properties/edit.html.erb_spec.rb +0 -21
  369. data/spec/views/manifestation_custom_properties/index.html.erb_spec.rb +0 -25
  370. data/spec/views/manifestation_custom_properties/new.html.erb_spec.rb +0 -21
  371. data/spec/views/manifestation_custom_properties/show.html.erb_spec.rb +0 -16
  372. data/spec/views/manifestations/show.json.jbuilder_spec.rb +0 -16
  373. data/spec/views/resource_import_results/index.txt.ruby_spec.rb +0 -22
@@ -1,449 +0,0 @@
1
- require 'rails_helper'
2
- require 'sunspot/rails/spec_helper'
3
-
4
- describe ItemCustomPropertiesController do
5
- fixtures :all
6
- disconnect_sunspot
7
-
8
- def valid_attributes
9
- @attrs = FactoryBot.attributes_for(:item_custom_property)
10
- end
11
-
12
- describe 'GET index' do
13
- before(:each) do
14
- FactoryBot.create(:item_custom_property)
15
- end
16
-
17
- describe 'When logged in as Administrator' do
18
- login_fixture_admin
19
-
20
- it 'assigns all item_custom_properties as @item_custom_properties' do
21
- get :index
22
- expect(assigns(:item_custom_properties)).to eq(ItemCustomProperty.order(:position))
23
- end
24
- end
25
-
26
- describe 'When logged in as Librarian' do
27
- login_fixture_librarian
28
-
29
- it 'assigns all item_custom_properties as @item_custom_properties' do
30
- get :index
31
- expect(assigns(:item_custom_properties)).to eq(ItemCustomProperty.order(:position))
32
- end
33
- end
34
-
35
- describe 'When logged in as User' do
36
- login_fixture_user
37
-
38
- it 'assigns all item_custom_properties as @item_custom_properties' do
39
- get :index
40
- expect(assigns(:item_custom_properties)).to eq nil
41
- end
42
- end
43
-
44
- describe 'When not logged in' do
45
- it 'assigns all item_custom_properties as @item_custom_properties' do
46
- get :index
47
- expect(assigns(:item_custom_properties)).to eq nil
48
- end
49
- end
50
- end
51
-
52
- describe 'GET show' do
53
- describe 'When logged in as Administrator' do
54
- login_fixture_admin
55
-
56
- it 'assigns the requested item_custom_property as @item_custom_property' do
57
- item_custom_property = FactoryBot.create(:item_custom_property)
58
- get :show, params: { id: item_custom_property.id }
59
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
60
- end
61
- end
62
-
63
- describe 'When logged in as Librarian' do
64
- login_fixture_librarian
65
-
66
- it 'assigns the requested item_custom_property as @item_custom_property' do
67
- item_custom_property = FactoryBot.create(:item_custom_property)
68
- get :show, params: { id: item_custom_property.id }
69
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
70
- end
71
- end
72
-
73
- describe 'When logged in as User' do
74
- login_fixture_user
75
-
76
- it 'assigns the requested item_custom_property as @item_custom_property' do
77
- item_custom_property = FactoryBot.create(:item_custom_property)
78
- get :show, params: { id: item_custom_property.id }
79
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
80
- end
81
- end
82
-
83
- describe 'When not logged in' do
84
- it 'assigns the requested item_custom_property as @item_custom_property' do
85
- item_custom_property = FactoryBot.create(:item_custom_property)
86
- get :show, params: { id: item_custom_property.id }
87
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
88
- end
89
- end
90
- end
91
-
92
- describe 'GET new' do
93
- describe 'When logged in as Administrator' do
94
- login_fixture_admin
95
-
96
- it 'assigns the requested item_custom_property as @item_custom_property' do
97
- get :new
98
- expect(assigns(:item_custom_property)).to be_a_new(ItemCustomProperty)
99
- expect(response).to be_successful
100
- end
101
- end
102
-
103
- describe 'When logged in as Librarian' do
104
- login_fixture_librarian
105
-
106
- it 'should not assign the requested item_custom_property as @item_custom_property' do
107
- get :new
108
- expect(assigns(:item_custom_property)).to be_nil
109
- expect(response).to be_forbidden
110
- end
111
- end
112
-
113
- describe 'When logged in as User' do
114
- login_fixture_user
115
-
116
- it 'should not assign the requested item_custom_property as @item_custom_property' do
117
- get :new
118
- expect(assigns(:item_custom_property)).to be_nil
119
- expect(response).to be_forbidden
120
- end
121
- end
122
-
123
- describe 'When not logged in' do
124
- it 'should not assign the requested item_custom_property as @item_custom_property' do
125
- get :new
126
- expect(assigns(:item_custom_property)).to be_nil
127
- expect(response).to redirect_to(new_user_session_url)
128
- end
129
- end
130
- end
131
-
132
- describe 'GET edit' do
133
- describe 'When logged in as Administrator' do
134
- login_fixture_admin
135
-
136
- it 'assigns the requested item_custom_property as @item_custom_property' do
137
- item_custom_property = FactoryBot.create(:item_custom_property)
138
- get :edit, params: { id: item_custom_property.id }
139
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
140
- end
141
- end
142
-
143
- describe 'When logged in as Librarian' do
144
- login_fixture_librarian
145
-
146
- it 'assigns the requested item_custom_property as @item_custom_property' do
147
- item_custom_property = FactoryBot.create(:item_custom_property)
148
- get :edit, params: { id: item_custom_property.id }
149
- expect(assigns(:item_custom_property)).to eq(item_custom_property)
150
- end
151
- end
152
-
153
- describe 'When logged in as User' do
154
- login_fixture_user
155
-
156
- it 'assigns the requested item_custom_property as @item_custom_property' do
157
- item_custom_property = FactoryBot.create(:item_custom_property)
158
- get :edit, params: { id: item_custom_property.id }
159
- expect(response).to be_forbidden
160
- end
161
- end
162
-
163
- describe 'When not logged in' do
164
- it 'should not assign the requested item_custom_property as @item_custom_property' do
165
- item_custom_property = FactoryBot.create(:item_custom_property)
166
- get :edit, params: { id: item_custom_property.id }
167
- expect(response).to redirect_to(new_user_session_url)
168
- end
169
- end
170
- end
171
-
172
- describe 'POST create' do
173
- before(:each) do
174
- @attrs = valid_attributes
175
- @invalid_attrs = { name: '' }
176
- end
177
-
178
- describe 'When logged in as Administrator' do
179
- login_fixture_admin
180
-
181
- describe 'with valid params' do
182
- it 'assigns a newly created item_custom_property as @item_custom_property' do
183
- post :create, params: { item_custom_property: @attrs }
184
- expect(assigns(:item_custom_property)).to be_valid
185
- end
186
-
187
- it 'redirects to the created item' do
188
- post :create, params: { item_custom_property: @attrs }
189
- expect(response).to redirect_to(assigns(:item_custom_property))
190
- end
191
- end
192
-
193
- describe 'with invalid params' do
194
- it 'assigns a newly created but unsaved item_custom_property as @item_custom_property' do
195
- post :create, params: { item_custom_property: @invalid_attrs }
196
- expect(assigns(:item_custom_property)).not_to be_valid
197
- end
198
-
199
- it "re-renders the 'new' template" do
200
- post :create, params: { item_custom_property: @invalid_attrs }
201
- expect(response).to render_template('new')
202
- end
203
- end
204
- end
205
-
206
- describe 'When logged in as Librarian' do
207
- login_fixture_librarian
208
-
209
- describe 'with valid params' do
210
- it 'assigns a newly created item_custom_property as @item_custom_property' do
211
- post :create, params: { item_custom_property: @attrs }
212
- expect(assigns(:item_custom_property)).to be_nil
213
- end
214
-
215
- it 'redirects to the created item' do
216
- post :create, params: { item_custom_property: @attrs }
217
- expect(response).to be_forbidden
218
- end
219
- end
220
-
221
- describe 'with invalid params' do
222
- it 'assigns a newly created but unsaved item_custom_property as @item_custom_property' do
223
- post :create, params: { item_custom_property: @invalid_attrs }
224
- expect(assigns(:item_custom_property)).to be_nil
225
- end
226
-
227
- it "re-renders the 'new' template" do
228
- post :create, params: { item_custom_property: @invalid_attrs }
229
- expect(response).to be_forbidden
230
- end
231
- end
232
- end
233
-
234
- describe 'When logged in as User' do
235
- login_fixture_user
236
-
237
- describe 'with valid params' do
238
- it 'assigns a newly created item_custom_property as @item_custom_property' do
239
- post :create, params: { item_custom_property: @attrs }
240
- expect(assigns(:item_custom_property)).to be_nil
241
- end
242
-
243
- it 'should be forbidden' do
244
- post :create, params: { item_custom_property: @attrs }
245
- expect(response).to be_forbidden
246
- end
247
- end
248
-
249
- describe 'with invalid params' do
250
- it 'assigns a newly created but unsaved item_custom_property as @item_custom_property' do
251
- post :create, params: { item_custom_property: @invalid_attrs }
252
- expect(assigns(:item_custom_property)).to be_nil
253
- end
254
-
255
- it 'should be forbidden' do
256
- post :create, params: { item_custom_property: @invalid_attrs }
257
- expect(response).to be_forbidden
258
- end
259
- end
260
- end
261
-
262
- describe 'When not logged in' do
263
- describe 'with valid params' do
264
- it 'assigns a newly created item_custom_property as @item_custom_property' do
265
- post :create, params: { item_custom_property: @attrs }
266
- expect(assigns(:item_custom_property)).to be_nil
267
- end
268
-
269
- it 'should be forbidden' do
270
- post :create, params: { item_custom_property: @attrs }
271
- expect(response).to redirect_to(new_user_session_url)
272
- end
273
- end
274
-
275
- describe 'with invalid params' do
276
- it 'assigns a newly created but unsaved item_custom_property as @item_custom_property' do
277
- post :create, params: { item_custom_property: @invalid_attrs }
278
- expect(assigns(:item_custom_property)).to be_nil
279
- end
280
-
281
- it 'should be forbidden' do
282
- post :create, params: { item_custom_property: @invalid_attrs }
283
- expect(response).to redirect_to(new_user_session_url)
284
- end
285
- end
286
- end
287
- end
288
-
289
- describe 'PUT update' do
290
- before(:each) do
291
- @item_custom_property = FactoryBot.create(:item_custom_property)
292
- @attrs = valid_attributes
293
- @invalid_attrs = { name: '' }
294
- end
295
-
296
- describe 'When logged in as Administrator' do
297
- login_fixture_admin
298
-
299
- describe 'with valid params' do
300
- it 'updates the requested item_custom_property' do
301
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
302
- end
303
-
304
- it 'assigns the requested item_custom_property as @item_custom_property' do
305
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
306
- expect(assigns(:item_custom_property)).to eq(@item_custom_property)
307
- expect(response).to redirect_to(@item_custom_property)
308
- end
309
- end
310
-
311
- describe 'with invalid params' do
312
- it 'assigns the requested item_custom_property as @item_custom_property' do
313
- put :update, params: { id: @item_custom_property.id, item_custom_property: @invalid_attrs }
314
- expect(response).to render_template('edit')
315
- end
316
- end
317
-
318
- it 'moves its position when specified' do
319
- item_custom_property = ItemCustomProperty.create! valid_attributes
320
- position = item_custom_property.position
321
- put :update, params: { id: item_custom_property.id, move: 'higher' }
322
- expect(response).to redirect_to item_custom_properties_url
323
- assigns(:item_custom_property).reload.position.should eq position - 1
324
- end
325
- end
326
-
327
- describe 'When logged in as Librarian' do
328
- login_fixture_librarian
329
-
330
- describe 'with valid params' do
331
- it 'updates the requested item_custom_property' do
332
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
333
- end
334
-
335
- it 'assigns the requested item_custom_property as @item_custom_property' do
336
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
337
- expect(assigns(:item_custom_property)).to eq @item_custom_property
338
- expect(response).to be_forbidden
339
- end
340
- end
341
-
342
- describe 'with invalid params' do
343
- it 'assigns the requested item_custom_property as @item_custom_property' do
344
- put :update, params: { id: @item_custom_property.id, item_custom_property: @invalid_attrs }
345
- expect(response).to be_forbidden
346
- end
347
- end
348
- end
349
-
350
- describe 'When logged in as User' do
351
- login_fixture_user
352
-
353
- describe 'with valid params' do
354
- it 'updates the requested item_custom_property' do
355
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
356
- end
357
-
358
- it 'assigns the requested item_custom_property as @item_custom_property' do
359
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
360
- expect(assigns(:item_custom_property)).to eq(@item_custom_property)
361
- expect(response).to be_forbidden
362
- end
363
- end
364
-
365
- describe 'with invalid params' do
366
- it 'assigns the requested item_custom_property as @item_custom_property' do
367
- put :update, params: { id: @item_custom_property.id, item_custom_property: @invalid_attrs }
368
- expect(response).to be_forbidden
369
- end
370
- end
371
- end
372
-
373
- describe 'When not logged in' do
374
- describe 'with valid params' do
375
- it 'updates the requested item_custom_property' do
376
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
377
- end
378
-
379
- it 'should be forbidden' do
380
- put :update, params: { id: @item_custom_property.id, item_custom_property: @attrs }
381
- expect(response).to redirect_to(new_user_session_url)
382
- end
383
- end
384
-
385
- describe 'with invalid params' do
386
- it 'assigns the requested item_custom_property as @item_custom_property' do
387
- put :update, params: { id: @item_custom_property.id, item_custom_property: @invalid_attrs }
388
- expect(response).to redirect_to(new_user_session_url)
389
- end
390
- end
391
- end
392
- end
393
-
394
- describe 'DELETE destroy' do
395
- before(:each) do
396
- @item_custom_property = FactoryBot.create(:item_custom_property)
397
- end
398
-
399
- describe 'When logged in as Administrator' do
400
- login_fixture_admin
401
-
402
- it 'destroys the requested item_custom_property' do
403
- delete :destroy, params: { id: @item_custom_property.id }
404
- end
405
-
406
- it 'redirects to the item_custom_properties list' do
407
- delete :destroy, params: { id: @item_custom_property.id }
408
- expect(response).to redirect_to(item_custom_properties_url)
409
- end
410
- end
411
-
412
- describe 'When logged in as Librarian' do
413
- login_fixture_librarian
414
-
415
- it 'destroys the requested item_custom_property' do
416
- delete :destroy, params: { id: @item_custom_property.id }
417
- end
418
-
419
- it 'should be forbidden' do
420
- delete :destroy, params: { id: @item_custom_property.id }
421
- expect(response).to be_forbidden
422
- end
423
- end
424
-
425
- describe 'When logged in as User' do
426
- login_fixture_user
427
-
428
- it 'destroys the requested item_custom_property' do
429
- delete :destroy, params: { id: @item_custom_property.id }
430
- end
431
-
432
- it 'should be forbidden' do
433
- delete :destroy, params: { id: @item_custom_property.id }
434
- expect(response).to be_forbidden
435
- end
436
- end
437
-
438
- describe 'When not logged in' do
439
- it 'destroys the requested item_custom_property' do
440
- delete :destroy, params: { id: @item_custom_property.id }
441
- end
442
-
443
- it 'should be forbidden' do
444
- delete :destroy, params: { id: @item_custom_property.id }
445
- expect(response).to redirect_to(new_user_session_url)
446
- end
447
- end
448
- end
449
- end
@@ -1,449 +0,0 @@
1
- require 'rails_helper'
2
- require 'sunspot/rails/spec_helper'
3
-
4
- describe ManifestationCustomPropertiesController do
5
- fixtures :all
6
- disconnect_sunspot
7
-
8
- def valid_attributes
9
- @attrs = FactoryBot.attributes_for(:manifestation_custom_property)
10
- end
11
-
12
- describe 'GET index' do
13
- before(:each) do
14
- FactoryBot.create(:manifestation_custom_property)
15
- end
16
-
17
- describe 'When logged in as Administrator' do
18
- login_fixture_admin
19
-
20
- it 'assigns all manifestation_custom_properties as @manifestation_custom_properties' do
21
- get :index
22
- expect(assigns(:manifestation_custom_properties)).to eq(ManifestationCustomProperty.order(:position))
23
- end
24
- end
25
-
26
- describe 'When logged in as Librarian' do
27
- login_fixture_librarian
28
-
29
- it 'assigns all manifestation_custom_properties as @manifestation_custom_properties' do
30
- get :index
31
- expect(assigns(:manifestation_custom_properties)).to eq(ManifestationCustomProperty.order(:position))
32
- end
33
- end
34
-
35
- describe 'When logged in as User' do
36
- login_fixture_user
37
-
38
- it 'assigns all manifestation_custom_properties as @manifestation_custom_properties' do
39
- get :index
40
- expect(assigns(:manifestation_custom_properties)).to eq nil
41
- end
42
- end
43
-
44
- describe 'When not logged in' do
45
- it 'assigns all manifestation_custom_properties as @manifestation_custom_properties' do
46
- get :index
47
- expect(assigns(:manifestation_custom_properties)).to eq nil
48
- end
49
- end
50
- end
51
-
52
- describe 'GET show' do
53
- describe 'When logged in as Administrator' do
54
- login_fixture_admin
55
-
56
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
57
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
58
- get :show, params: { id: manifestation_custom_property.id }
59
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
60
- end
61
- end
62
-
63
- describe 'When logged in as Librarian' do
64
- login_fixture_librarian
65
-
66
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
67
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
68
- get :show, params: { id: manifestation_custom_property.id }
69
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
70
- end
71
- end
72
-
73
- describe 'When logged in as User' do
74
- login_fixture_user
75
-
76
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
77
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
78
- get :show, params: { id: manifestation_custom_property.id }
79
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
80
- end
81
- end
82
-
83
- describe 'When not logged in' do
84
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
85
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
86
- get :show, params: { id: manifestation_custom_property.id }
87
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
88
- end
89
- end
90
- end
91
-
92
- describe 'GET new' do
93
- describe 'When logged in as Administrator' do
94
- login_fixture_admin
95
-
96
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
97
- get :new
98
- expect(assigns(:manifestation_custom_property)).to be_a_new(ManifestationCustomProperty)
99
- expect(response).to be_successful
100
- end
101
- end
102
-
103
- describe 'When logged in as Librarian' do
104
- login_fixture_librarian
105
-
106
- it 'should not assign the requested manifestation_custom_property as @manifestation_custom_property' do
107
- get :new
108
- expect(assigns(:manifestation_custom_property)).to be_nil
109
- expect(response).to be_forbidden
110
- end
111
- end
112
-
113
- describe 'When logged in as User' do
114
- login_fixture_user
115
-
116
- it 'should not assign the requested manifestation_custom_property as @manifestation_custom_property' do
117
- get :new
118
- expect(assigns(:manifestation_custom_property)).to be_nil
119
- expect(response).to be_forbidden
120
- end
121
- end
122
-
123
- describe 'When not logged in' do
124
- it 'should not assign the requested manifestation_custom_property as @manifestation_custom_property' do
125
- get :new
126
- expect(assigns(:manifestation_custom_property)).to be_nil
127
- expect(response).to redirect_to(new_user_session_url)
128
- end
129
- end
130
- end
131
-
132
- describe 'GET edit' do
133
- describe 'When logged in as Administrator' do
134
- login_fixture_admin
135
-
136
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
137
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
138
- get :edit, params: { id: manifestation_custom_property.id }
139
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
140
- end
141
- end
142
-
143
- describe 'When logged in as Librarian' do
144
- login_fixture_librarian
145
-
146
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
147
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
148
- get :edit, params: { id: manifestation_custom_property.id }
149
- expect(assigns(:manifestation_custom_property)).to eq(manifestation_custom_property)
150
- end
151
- end
152
-
153
- describe 'When logged in as User' do
154
- login_fixture_user
155
-
156
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
157
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
158
- get :edit, params: { id: manifestation_custom_property.id }
159
- expect(response).to be_forbidden
160
- end
161
- end
162
-
163
- describe 'When not logged in' do
164
- it 'should not assign the requested manifestation_custom_property as @manifestation_custom_property' do
165
- manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
166
- get :edit, params: { id: manifestation_custom_property.id }
167
- expect(response).to redirect_to(new_user_session_url)
168
- end
169
- end
170
- end
171
-
172
- describe 'POST create' do
173
- before(:each) do
174
- @attrs = valid_attributes
175
- @invalid_attrs = { name: '' }
176
- end
177
-
178
- describe 'When logged in as Administrator' do
179
- login_fixture_admin
180
-
181
- describe 'with valid params' do
182
- it 'assigns a newly created manifestation_custom_property as @manifestation_custom_property' do
183
- post :create, params: { manifestation_custom_property: @attrs }
184
- expect(assigns(:manifestation_custom_property)).to be_valid
185
- end
186
-
187
- it 'redirects to the created manifestation' do
188
- post :create, params: { manifestation_custom_property: @attrs }
189
- expect(response).to redirect_to(assigns(:manifestation_custom_property))
190
- end
191
- end
192
-
193
- describe 'with invalid params' do
194
- it 'assigns a newly created but unsaved manifestation_custom_property as @manifestation_custom_property' do
195
- post :create, params: { manifestation_custom_property: @invalid_attrs }
196
- expect(assigns(:manifestation_custom_property)).not_to be_valid
197
- end
198
-
199
- it "re-renders the 'new' template" do
200
- post :create, params: { manifestation_custom_property: @invalid_attrs }
201
- expect(response).to render_template('new')
202
- end
203
- end
204
- end
205
-
206
- describe 'When logged in as Librarian' do
207
- login_fixture_librarian
208
-
209
- describe 'with valid params' do
210
- it 'assigns a newly created manifestation_custom_property as @manifestation_custom_property' do
211
- post :create, params: { manifestation_custom_property: @attrs }
212
- expect(assigns(:manifestation_custom_property)).to be_nil
213
- end
214
-
215
- it 'redirects to the created manifestation' do
216
- post :create, params: { manifestation_custom_property: @attrs }
217
- expect(response).to be_forbidden
218
- end
219
- end
220
-
221
- describe 'with invalid params' do
222
- it 'assigns a newly created but unsaved manifestation_custom_property as @manifestation_custom_property' do
223
- post :create, params: { manifestation_custom_property: @invalid_attrs }
224
- expect(assigns(:manifestation_custom_property)).to be_nil
225
- end
226
-
227
- it "re-renders the 'new' template" do
228
- post :create, params: { manifestation_custom_property: @invalid_attrs }
229
- expect(response).to be_forbidden
230
- end
231
- end
232
- end
233
-
234
- describe 'When logged in as User' do
235
- login_fixture_user
236
-
237
- describe 'with valid params' do
238
- it 'assigns a newly created manifestation_custom_property as @manifestation_custom_property' do
239
- post :create, params: { manifestation_custom_property: @attrs }
240
- expect(assigns(:manifestation_custom_property)).to be_nil
241
- end
242
-
243
- it 'should be forbidden' do
244
- post :create, params: { manifestation_custom_property: @attrs }
245
- expect(response).to be_forbidden
246
- end
247
- end
248
-
249
- describe 'with invalid params' do
250
- it 'assigns a newly created but unsaved manifestation_custom_property as @manifestation_custom_property' do
251
- post :create, params: { manifestation_custom_property: @invalid_attrs }
252
- expect(assigns(:manifestation_custom_property)).to be_nil
253
- end
254
-
255
- it 'should be forbidden' do
256
- post :create, params: { manifestation_custom_property: @invalid_attrs }
257
- expect(response).to be_forbidden
258
- end
259
- end
260
- end
261
-
262
- describe 'When not logged in' do
263
- describe 'with valid params' do
264
- it 'assigns a newly created manifestation_custom_property as @manifestation_custom_property' do
265
- post :create, params: { manifestation_custom_property: @attrs }
266
- expect(assigns(:manifestation_custom_property)).to be_nil
267
- end
268
-
269
- it 'should be forbidden' do
270
- post :create, params: { manifestation_custom_property: @attrs }
271
- expect(response).to redirect_to(new_user_session_url)
272
- end
273
- end
274
-
275
- describe 'with invalid params' do
276
- it 'assigns a newly created but unsaved manifestation_custom_property as @manifestation_custom_property' do
277
- post :create, params: { manifestation_custom_property: @invalid_attrs }
278
- expect(assigns(:manifestation_custom_property)).to be_nil
279
- end
280
-
281
- it 'should be forbidden' do
282
- post :create, params: { manifestation_custom_property: @invalid_attrs }
283
- expect(response).to redirect_to(new_user_session_url)
284
- end
285
- end
286
- end
287
- end
288
-
289
- describe 'PUT update' do
290
- before(:each) do
291
- @manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
292
- @attrs = valid_attributes
293
- @invalid_attrs = { name: '' }
294
- end
295
-
296
- describe 'When logged in as Administrator' do
297
- login_fixture_admin
298
-
299
- describe 'with valid params' do
300
- it 'updates the requested manifestation_custom_property' do
301
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
302
- end
303
-
304
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
305
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
306
- expect(assigns(:manifestation_custom_property)).to eq(@manifestation_custom_property)
307
- expect(response).to redirect_to(@manifestation_custom_property)
308
- end
309
- end
310
-
311
- describe 'with invalid params' do
312
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
313
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @invalid_attrs }
314
- expect(response).to render_template('edit')
315
- end
316
- end
317
-
318
- it 'moves its position when specified' do
319
- manifestation_custom_property = ManifestationCustomProperty.create! valid_attributes
320
- position = manifestation_custom_property.position
321
- put :update, params: { id: manifestation_custom_property.id, move: 'higher' }
322
- expect(response).to redirect_to manifestation_custom_properties_url
323
- assigns(:manifestation_custom_property).reload.position.should eq position - 1
324
- end
325
- end
326
-
327
- describe 'When logged in as Librarian' do
328
- login_fixture_librarian
329
-
330
- describe 'with valid params' do
331
- it 'updates the requested manifestation_custom_property' do
332
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
333
- end
334
-
335
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
336
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
337
- expect(assigns(:manifestation_custom_property)).to eq @manifestation_custom_property
338
- expect(response).to be_forbidden
339
- end
340
- end
341
-
342
- describe 'with invalid params' do
343
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
344
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @invalid_attrs }
345
- expect(response).to be_forbidden
346
- end
347
- end
348
- end
349
-
350
- describe 'When logged in as User' do
351
- login_fixture_user
352
-
353
- describe 'with valid params' do
354
- it 'updates the requested manifestation_custom_property' do
355
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
356
- end
357
-
358
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
359
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
360
- expect(assigns(:manifestation_custom_property)).to eq(@manifestation_custom_property)
361
- expect(response).to be_forbidden
362
- end
363
- end
364
-
365
- describe 'with invalid params' do
366
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
367
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @invalid_attrs }
368
- expect(response).to be_forbidden
369
- end
370
- end
371
- end
372
-
373
- describe 'When not logged in' do
374
- describe 'with valid params' do
375
- it 'updates the requested manifestation_custom_property' do
376
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
377
- end
378
-
379
- it 'should be forbidden' do
380
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @attrs }
381
- expect(response).to redirect_to(new_user_session_url)
382
- end
383
- end
384
-
385
- describe 'with invalid params' do
386
- it 'assigns the requested manifestation_custom_property as @manifestation_custom_property' do
387
- put :update, params: { id: @manifestation_custom_property.id, manifestation_custom_property: @invalid_attrs }
388
- expect(response).to redirect_to(new_user_session_url)
389
- end
390
- end
391
- end
392
- end
393
-
394
- describe 'DELETE destroy' do
395
- before(:each) do
396
- @manifestation_custom_property = FactoryBot.create(:manifestation_custom_property)
397
- end
398
-
399
- describe 'When logged in as Administrator' do
400
- login_fixture_admin
401
-
402
- it 'destroys the requested manifestation_custom_property' do
403
- delete :destroy, params: { id: @manifestation_custom_property.id }
404
- end
405
-
406
- it 'redirects to the manifestation_custom_properties list' do
407
- delete :destroy, params: { id: @manifestation_custom_property.id }
408
- expect(response).to redirect_to(manifestation_custom_properties_url)
409
- end
410
- end
411
-
412
- describe 'When logged in as Librarian' do
413
- login_fixture_librarian
414
-
415
- it 'destroys the requested manifestation_custom_property' do
416
- delete :destroy, params: { id: @manifestation_custom_property.id }
417
- end
418
-
419
- it 'should be forbidden' do
420
- delete :destroy, params: { id: @manifestation_custom_property.id }
421
- expect(response).to be_forbidden
422
- end
423
- end
424
-
425
- describe 'When logged in as User' do
426
- login_fixture_user
427
-
428
- it 'destroys the requested manifestation_custom_property' do
429
- delete :destroy, params: { id: @manifestation_custom_property.id }
430
- end
431
-
432
- it 'should be forbidden' do
433
- delete :destroy, params: { id: @manifestation_custom_property.id }
434
- expect(response).to be_forbidden
435
- end
436
- end
437
-
438
- describe 'When not logged in' do
439
- it 'destroys the requested manifestation_custom_property' do
440
- delete :destroy, params: { id: @manifestation_custom_property.id }
441
- end
442
-
443
- it 'should be forbidden' do
444
- delete :destroy, params: { id: @manifestation_custom_property.id }
445
- expect(response).to redirect_to(new_user_session_url)
446
- end
447
- end
448
- end
449
- end