enju_biblio 0.1.0.pre52 → 0.1.0.pre53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +6 -0
  3. data/app/controllers/agent_import_results_controller.rb +1 -1
  4. data/app/controllers/manifestations_controller.rb +8 -0
  5. data/app/controllers/resource_export_files_controller.rb +100 -0
  6. data/app/controllers/resource_import_files_controller.rb +6 -0
  7. data/app/controllers/resource_import_results_controller.rb +2 -2
  8. data/app/models/agent.rb +0 -2
  9. data/app/models/agent_import_file.rb +38 -52
  10. data/app/models/agent_import_file_state_machine.rb +19 -0
  11. data/app/models/agent_import_file_transition.rb +20 -0
  12. data/app/models/enju_biblio/ability.rb +14 -12
  13. data/app/models/import_request.rb +21 -17
  14. data/app/models/import_request_state_machine.rb +9 -0
  15. data/app/models/import_request_transition.rb +20 -0
  16. data/app/models/item.rb +0 -2
  17. data/app/models/manifestation.rb +63 -2
  18. data/app/models/resource_export_file.rb +59 -0
  19. data/app/models/resource_export_file_state_machine.rb +15 -0
  20. data/app/models/resource_export_file_transition.rb +20 -0
  21. data/app/models/resource_import_file.rb +42 -57
  22. data/app/models/resource_import_file_state_machine.rb +19 -0
  23. data/app/models/resource_import_file_transition.rb +20 -0
  24. data/app/views/agent_import_files/edit.html.erb +2 -2
  25. data/app/views/agent_import_files/index.html.erb +4 -4
  26. data/app/views/agent_import_files/new.html.erb +16 -3
  27. data/app/views/agent_import_files/show.html.erb +13 -3
  28. data/app/views/agent_import_results/index.html.erb +6 -6
  29. data/app/views/agent_import_results/{index.csv.erb → index.tsv.erb} +0 -0
  30. data/app/views/agent_import_results/show.html.erb +2 -2
  31. data/app/views/agent_relationship_types/edit.html.erb +2 -2
  32. data/app/views/agent_relationship_types/index.html.erb +2 -2
  33. data/app/views/agent_relationship_types/new.html.erb +2 -2
  34. data/app/views/agent_relationship_types/show.html.erb +2 -2
  35. data/app/views/agent_relationships/edit.html.erb +2 -2
  36. data/app/views/agent_relationships/index.html.erb +2 -2
  37. data/app/views/agent_relationships/new.html.erb +2 -2
  38. data/app/views/agent_relationships/show.html.erb +2 -2
  39. data/app/views/agent_types/edit.html.erb +2 -2
  40. data/app/views/agent_types/index.html.erb +2 -2
  41. data/app/views/agent_types/new.html.erb +2 -2
  42. data/app/views/agent_types/show.html.erb +2 -2
  43. data/app/views/agents/_index.html.erb +2 -2
  44. data/app/views/agents/_index_agent.html.erb +2 -2
  45. data/app/views/agents/_index_expression.html.erb +2 -2
  46. data/app/views/agents/_index_manifestation.html.erb +2 -2
  47. data/app/views/agents/_index_work.html.erb +2 -2
  48. data/app/views/agents/edit.html.erb +2 -2
  49. data/app/views/agents/new.html.erb +2 -2
  50. data/app/views/agents/show.html.erb +2 -2
  51. data/app/views/carrier_types/edit.html.erb +2 -2
  52. data/app/views/carrier_types/index.html.erb +2 -2
  53. data/app/views/carrier_types/new.html.erb +2 -2
  54. data/app/views/carrier_types/show.html.erb +2 -2
  55. data/app/views/content_types/edit.html.erb +2 -2
  56. data/app/views/content_types/index.html.erb +2 -2
  57. data/app/views/content_types/new.html.erb +2 -2
  58. data/app/views/content_types/show.html.erb +2 -2
  59. data/app/views/countries/edit.html.erb +2 -2
  60. data/app/views/countries/index.html.erb +2 -2
  61. data/app/views/countries/new.html.erb +2 -2
  62. data/app/views/countries/show.html.erb +2 -2
  63. data/app/views/create_types/edit.html.erb +2 -2
  64. data/app/views/create_types/index.html.erb +2 -2
  65. data/app/views/create_types/new.html.erb +2 -2
  66. data/app/views/create_types/show.html.erb +2 -2
  67. data/app/views/creates/_index.html.erb +2 -2
  68. data/app/views/creates/_index_agent.html.erb +2 -2
  69. data/app/views/creates/_index_work.html.erb +2 -2
  70. data/app/views/creates/edit.html.erb +2 -2
  71. data/app/views/creates/new.html.erb +2 -2
  72. data/app/views/creates/show.html.erb +2 -2
  73. data/app/views/donates/edit.html.erb +2 -2
  74. data/app/views/donates/index.html.erb +2 -2
  75. data/app/views/donates/new.html.erb +2 -2
  76. data/app/views/donates/show.html.erb +2 -2
  77. data/app/views/exemplifies/edit.html.erb +2 -2
  78. data/app/views/exemplifies/index.html.erb +2 -2
  79. data/app/views/exemplifies/new.html.erb +2 -2
  80. data/app/views/exemplifies/show.html.erb +2 -2
  81. data/app/views/extents/edit.html.erb +2 -2
  82. data/app/views/extents/index.html.erb +2 -2
  83. data/app/views/extents/new.html.erb +2 -2
  84. data/app/views/extents/show.html.erb +2 -2
  85. data/app/views/form_of_works/edit.html.erb +2 -2
  86. data/app/views/form_of_works/index.html.erb +2 -2
  87. data/app/views/form_of_works/new.html.erb +2 -2
  88. data/app/views/form_of_works/show.html.erb +2 -2
  89. data/app/views/frequencies/edit.html.erb +2 -2
  90. data/app/views/frequencies/index.html.erb +2 -2
  91. data/app/views/frequencies/new.html.erb +2 -2
  92. data/app/views/frequencies/show.html.erb +2 -2
  93. data/app/views/identifier_types/edit.html.erb +2 -2
  94. data/app/views/identifier_types/index.html.erb +2 -2
  95. data/app/views/identifier_types/new.html.erb +2 -2
  96. data/app/views/identifier_types/show.html.erb +2 -2
  97. data/app/views/import_requests/edit.html.erb +2 -2
  98. data/app/views/import_requests/index.html.erb +9 -7
  99. data/app/views/import_requests/new.html.erb +2 -2
  100. data/app/views/import_requests/show.html.erb +3 -3
  101. data/app/views/items/_form.html.erb +1 -1
  102. data/app/views/items/edit.html.erb +2 -2
  103. data/app/views/items/index.html.erb +2 -2
  104. data/app/views/items/new.html.erb +2 -2
  105. data/app/views/items/show.html.erb +2 -2
  106. data/app/views/languages/edit.html.erb +2 -2
  107. data/app/views/languages/index.html.erb +2 -2
  108. data/app/views/languages/new.html.erb +2 -2
  109. data/app/views/languages/show.html.erb +2 -2
  110. data/app/views/licenses/edit.html.erb +2 -2
  111. data/app/views/licenses/index.html.erb +2 -2
  112. data/app/views/licenses/new.html.erb +2 -2
  113. data/app/views/licenses/show.html.erb +2 -2
  114. data/app/views/manifestation_relationship_types/edit.html.erb +2 -2
  115. data/app/views/manifestation_relationship_types/index.html.erb +2 -2
  116. data/app/views/manifestation_relationship_types/new.html.erb +2 -2
  117. data/app/views/manifestation_relationship_types/show.html.erb +2 -2
  118. data/app/views/manifestation_relationships/edit.html.erb +2 -2
  119. data/app/views/manifestation_relationships/index.html.erb +2 -2
  120. data/app/views/manifestation_relationships/new.html.erb +2 -2
  121. data/app/views/manifestation_relationships/show.html.erb +2 -2
  122. data/app/views/manifestations/_pickup.html.erb +1 -1
  123. data/app/views/manifestations/_show_detail_librarian.html.erb +1 -1
  124. data/app/views/manifestations/_show_detail_user.html.erb +2 -2
  125. data/app/views/manifestations/_show_holding.html.erb +6 -1
  126. data/app/views/manifestations/_title.html.erb +1 -1
  127. data/app/views/manifestations/_title.mobile.erb +1 -1
  128. data/app/views/manifestations/edit.html.erb +2 -2
  129. data/app/views/manifestations/index.html.erb +2 -2
  130. data/app/views/manifestations/index.sru.builder +1 -1
  131. data/app/views/manifestations/new.html.erb +2 -2
  132. data/app/views/manifestations/show.html.erb +3 -3
  133. data/app/views/manifestations/show.mobile.erb +1 -1
  134. data/app/views/medium_of_performances/edit.html.erb +2 -2
  135. data/app/views/medium_of_performances/index.html.erb +2 -2
  136. data/app/views/medium_of_performances/new.html.erb +2 -2
  137. data/app/views/medium_of_performances/show.html.erb +2 -2
  138. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  139. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  140. data/app/views/owns/edit.html.erb +2 -2
  141. data/app/views/owns/index.html.erb +2 -2
  142. data/app/views/owns/new.html.erb +2 -2
  143. data/app/views/owns/show.html.erb +2 -2
  144. data/app/views/picture_files/_index.html.erb +2 -2
  145. data/app/views/picture_files/_index_agent.html.erb +2 -2
  146. data/app/views/picture_files/_index_event.html.erb +2 -2
  147. data/app/views/picture_files/_index_manifestation.html.erb +2 -2
  148. data/app/views/picture_files/_index_shelf.html.erb +2 -2
  149. data/app/views/picture_files/edit.html.erb +2 -2
  150. data/app/views/picture_files/new.html.erb +2 -2
  151. data/app/views/picture_files/show.html.erb +2 -2
  152. data/app/views/produce_types/edit.html.erb +2 -2
  153. data/app/views/produce_types/index.html.erb +2 -2
  154. data/app/views/produce_types/new.html.erb +2 -2
  155. data/app/views/produce_types/show.html.erb +2 -2
  156. data/app/views/produces/_index.html.erb +2 -2
  157. data/app/views/produces/_index_agent.html.erb +2 -2
  158. data/app/views/produces/_index_manifestation.html.erb +2 -2
  159. data/app/views/produces/edit.html.erb +2 -2
  160. data/app/views/produces/new.html.erb +2 -2
  161. data/app/views/produces/show.html.erb +2 -2
  162. data/app/views/realize_types/edit.html.erb +2 -2
  163. data/app/views/realize_types/index.html.erb +2 -2
  164. data/app/views/realize_types/new.html.erb +2 -2
  165. data/app/views/realize_types/show.html.erb +2 -2
  166. data/app/views/realizes/_index.html.erb +2 -2
  167. data/app/views/realizes/_index_agent.html.erb +2 -2
  168. data/app/views/realizes/_index_expression.html.erb +2 -2
  169. data/app/views/realizes/edit.html.erb +2 -2
  170. data/app/views/realizes/new.html.erb +2 -2
  171. data/app/views/realizes/show.html.erb +2 -2
  172. data/app/views/resource_export_files/_form.html.erb +22 -0
  173. data/app/views/resource_export_files/edit.html.erb +6 -0
  174. data/app/views/resource_export_files/index.html.erb +44 -0
  175. data/app/views/resource_export_files/new.html.erb +16 -0
  176. data/app/views/resource_export_files/show.html.erb +31 -0
  177. data/app/views/resource_import_files/edit.html.erb +2 -2
  178. data/app/views/resource_import_files/index.html.erb +4 -4
  179. data/app/views/resource_import_files/new.html.erb +16 -3
  180. data/app/views/resource_import_files/show.html.erb +13 -3
  181. data/app/views/resource_import_results/index.html.erb +6 -6
  182. data/app/views/resource_import_results/{index.csv.erb → index.tsv.erb} +0 -0
  183. data/app/views/resource_import_results/show.html.erb +2 -2
  184. data/app/views/series_statements/_index.html.erb +2 -2
  185. data/app/views/series_statements/_index_manifestation.html.erb +2 -2
  186. data/app/views/series_statements/_index_series_statement_merge_list.html.erb +2 -2
  187. data/app/views/series_statements/edit.html.erb +2 -2
  188. data/app/views/series_statements/new.html.erb +2 -2
  189. data/app/views/series_statements/show.html.erb +2 -2
  190. data/app/workers/agent_import_file_queue.rb +7 -0
  191. data/app/workers/resource_export_file_queue.rb +7 -0
  192. data/app/workers/resource_import_file_queue.rb +7 -0
  193. data/config/locales/translation_en.yml +12 -1
  194. data/config/locales/translation_ja.yml +12 -0
  195. data/config/routes.rb +3 -1
  196. data/db/migrate/001_create_agents.rb +0 -1
  197. data/db/migrate/005_create_manifestations.rb +0 -1
  198. data/db/migrate/006_create_items.rb +0 -1
  199. data/db/migrate/20081028083142_create_agent_import_files.rb +0 -2
  200. data/db/migrate/20081028083208_create_resource_import_files.rb +0 -2
  201. data/db/migrate/20100129142347_create_import_requests.rb +0 -1
  202. data/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
  203. data/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
  204. data/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
  205. data/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  206. data/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
  207. data/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  208. data/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  209. data/lib/enju_biblio/engine.rb +1 -0
  210. data/lib/enju_biblio/version.rb +1 -1
  211. data/lib/generators/enju_biblio/setup/templates/config/schedule.rb +1 -1
  212. data/spec/controllers/manifestations_controller_spec.rb +4 -4
  213. data/spec/controllers/resource_export_files_controller_spec.rb +292 -0
  214. data/spec/dummy/app/models/ability.rb +1 -0
  215. data/spec/dummy/config/initializers/statesman.rb +3 -0
  216. data/spec/dummy/db/migrate/154_create_messages.rb +0 -1
  217. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +0 -2
  218. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +0 -2
  219. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +0 -1
  220. data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +0 -3
  221. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +0 -1
  222. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +0 -1
  223. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +0 -1
  224. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +0 -4
  225. data/spec/dummy/db/schema.rb +63 -31
  226. data/spec/dummy/db/test.sqlite3 +0 -0
  227. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
  228. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140705-26819-14hii8j.txt +147 -0
  229. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  230. data/spec/dummy/solr/default/data/index/segments_1 +0 -0
  231. data/spec/dummy/solr/test/data/index/segments.gen +0 -0
  232. data/spec/dummy/solr/test/data/index/segments_6y +0 -0
  233. data/spec/dummy/solr/test/data/tlog/{tlog.0000000000000016453 → tlog.0000000000000000243} +0 -0
  234. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000244 +0 -0
  235. data/spec/dummy/solr/test/data/tlog/{tlog.0000000000000016455 → tlog.0000000000000000245} +0 -0
  236. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000246 +0 -0
  237. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000247 +0 -0
  238. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000000248 +0 -0
  239. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  240. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  241. data/spec/factories/create_types.rb +13 -0
  242. data/spec/factories/produce_types.rb +13 -0
  243. data/spec/factories/realize_types.rb +13 -0
  244. data/spec/fixtures/agent_import_files.yml +1 -5
  245. data/spec/fixtures/agents.yml +0 -2
  246. data/spec/fixtures/import_requests.yml +0 -4
  247. data/spec/fixtures/items.yml +0 -2
  248. data/spec/fixtures/manifestation_checkout_stats.yml +0 -2
  249. data/spec/fixtures/manifestation_reserve_stats.yml +0 -2
  250. data/spec/fixtures/manifestations.yml +0 -2
  251. data/spec/fixtures/message_requests.yml +0 -2
  252. data/spec/fixtures/messages.yml +0 -4
  253. data/spec/fixtures/resource_export_files.yml +26 -0
  254. data/spec/fixtures/resource_import_files.yml +1 -4
  255. data/spec/fixtures/user_checkout_stats.yml +0 -2
  256. data/spec/fixtures/user_reserve_stats.yml +0 -2
  257. data/spec/models/agent_import_file_spec.rb +14 -8
  258. data/spec/models/agent_spec.rb +4 -6
  259. data/spec/models/import_request_spec.rb +0 -2
  260. data/spec/models/item_spec.rb +7 -8
  261. data/spec/models/manifestation_spec.rb +8 -10
  262. data/spec/models/resource_export_file_spec.rb +28 -0
  263. data/spec/models/resource_import_file_spec.rb +15 -5
  264. data/spec/routing/manifestations_routing_spec.rb +1 -1
  265. data/spec/routing/resource_export_files_routing_spec.rb +35 -0
  266. data/spec/spec_helper.rb +3 -0
  267. data/spec/support/resque.rb +32 -0
  268. data/spec/views/import_requests/edit.html.erb_spec.rb +19 -0
  269. data/spec/views/import_requests/index.html.erb_spec.rb +33 -0
  270. data/spec/views/import_requests/new.html.erb_spec.rb +21 -0
  271. data/spec/views/import_requests/show.html.erb_spec.rb +22 -0
  272. data/spec/views/resource_export_files/edit.html.erb_spec.rb +16 -0
  273. data/spec/views/resource_export_files/index.html.erb_spec.rb +17 -0
  274. data/spec/views/resource_export_files/new.html.erb_spec.rb +16 -0
  275. data/spec/views/resource_export_files/show.html.erb_spec.rb +13 -0
  276. metadata +139 -157
  277. data/app/views/manifestations/_series_form.html.erb +0 -127
  278. data/spec/dummy/db/development.sqlite3 +0 -0
  279. data/spec/dummy/solr/default/data/index/_da.fdt +0 -0
  280. data/spec/dummy/solr/default/data/index/_da.fdx +0 -0
  281. data/spec/dummy/solr/default/data/index/_da.fnm +0 -0
  282. data/spec/dummy/solr/default/data/index/_da.nvd +0 -0
  283. data/spec/dummy/solr/default/data/index/_da.nvm +0 -0
  284. data/spec/dummy/solr/default/data/index/_da.si +0 -0
  285. data/spec/dummy/solr/default/data/index/_da_Lucene41_0.doc +0 -0
  286. data/spec/dummy/solr/default/data/index/_da_Lucene41_0.pos +0 -0
  287. data/spec/dummy/solr/default/data/index/_da_Lucene41_0.tim +0 -0
  288. data/spec/dummy/solr/default/data/index/_da_Lucene41_0.tip +0 -0
  289. data/spec/dummy/solr/default/data/index/segments_ip +0 -0
  290. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000668 +0 -0
  291. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000669 +0 -0
  292. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000670 +0 -0
  293. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000671 +0 -0
  294. data/spec/dummy/solr/test/data/index/segments_cp8 +0 -0
  295. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000016454 +0 -0
  296. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000016456 +0 -0
  297. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000016457 +0 -0
  298. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000016458 +0 -0
  299. data/spec/dummy/tmp/cache/assets/test/sprockets/01c388ec88c5fa6d00409d725549a506 +0 -0
  300. data/spec/dummy/tmp/cache/assets/test/sprockets/0440b81b0aae840cf287a686585a8cec +0 -0
  301. data/spec/dummy/tmp/cache/assets/test/sprockets/0c8f59d97121b79a2e2a0d009d6da9c3 +0 -0
  302. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  303. data/spec/dummy/tmp/cache/assets/test/sprockets/1572dfd6f1e555f4be1aa60ddc3cb0c0 +0 -0
  304. data/spec/dummy/tmp/cache/assets/test/sprockets/19a44bc29c5173edea456f9416243854 +0 -0
  305. data/spec/dummy/tmp/cache/assets/test/sprockets/2d65b40e585725207fd52ce4cf5134f4 +0 -0
  306. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  307. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  308. data/spec/dummy/tmp/cache/assets/test/sprockets/3fc2b4de95dbb94dfe82ccfc97265cc4 +0 -0
  309. data/spec/dummy/tmp/cache/assets/test/sprockets/4aa18096a209e515f5f1df487622cdf4 +0 -0
  310. data/spec/dummy/tmp/cache/assets/test/sprockets/4db7c7b5ea13aacccd89ea32460e2de0 +0 -0
  311. data/spec/dummy/tmp/cache/assets/test/sprockets/55de678ed3c84c51b3a4b4cf473da823 +0 -0
  312. data/spec/dummy/tmp/cache/assets/test/sprockets/64ee480e95febf6b404c1264755ea42e +0 -0
  313. data/spec/dummy/tmp/cache/assets/test/sprockets/7de140ed6f303b9d00d8d703cced3349 +0 -0
  314. data/spec/dummy/tmp/cache/assets/test/sprockets/80348afae86df384b25e1e3bff21b13e +0 -0
  315. data/spec/dummy/tmp/cache/assets/test/sprockets/814bc1bed3effa0bb4588eb8b75ab92a +0 -0
  316. data/spec/dummy/tmp/cache/assets/test/sprockets/8488002e0e6035b7d00c3800c2c0e27e +0 -0
  317. data/spec/dummy/tmp/cache/assets/test/sprockets/86dfe8a3e156aeb6ebcd456b2251fab7 +0 -0
  318. data/spec/dummy/tmp/cache/assets/test/sprockets/89c9228bae34e0ff18fd8fe7f6eb5847 +0 -0
  319. data/spec/dummy/tmp/cache/assets/test/sprockets/a2474b74df12470fb37c668b85b562c6 +0 -0
  320. data/spec/dummy/tmp/cache/assets/test/sprockets/a2ee8688f63b884277632a234086f7df +0 -0
  321. data/spec/dummy/tmp/cache/assets/test/sprockets/a3cea75f1356ef55329e78f86b4c72b1 +0 -0
  322. data/spec/dummy/tmp/cache/assets/test/sprockets/aa2e1ada35daa496bb08e85fcb817536 +0 -0
  323. data/spec/dummy/tmp/cache/assets/test/sprockets/b0e11c6d89683eaa7256a44a164a2a12 +0 -0
  324. data/spec/dummy/tmp/cache/assets/test/sprockets/bf17ca8affe2a1febca7f2a4e37cd77b +0 -0
  325. data/spec/dummy/tmp/cache/assets/test/sprockets/c36b7431da1ae91722b1c4091e4ba084 +0 -0
  326. data/spec/dummy/tmp/cache/assets/test/sprockets/c40786442706ae0cc6c793c6ee2500d3 +0 -0
  327. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  328. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  329. data/spec/dummy/tmp/cache/assets/test/sprockets/e58908ad0ccad6546faf9bcab669b0cd +0 -0
  330. data/spec/dummy/tmp/cache/assets/test/sprockets/e8f801eeda49cba4a03cfd9e2a4562ae +0 -0
  331. data/spec/dummy/tmp/cache/assets/test/sprockets/eef93e7d091d8118419fb96adf80387b +0 -0
  332. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  333. data/spec/dummy/tmp/cache/assets/test/sprockets/fb91323d4585f2e27d281cdb4193beb1 +0 -0
  334. data/spec/dummy/tmp/cache/assets/test/sprockets/ff64e9ded481959dfa8c78718e59e607 +0 -0
@@ -20,10 +20,8 @@ end
20
20
  #
21
21
  # id :integer not null, primary key
22
22
  # isbn :string(255)
23
- # state :string(255)
24
23
  # manifestation_id :integer
25
24
  # user_id :integer
26
25
  # created_at :datetime not null
27
26
  # updated_at :datetime not null
28
27
  #
29
-
@@ -15,7 +15,6 @@
15
15
  # price :integer
16
16
  # lock_version :integer default(0), not null
17
17
  # required_role_id :integer default(1), not null
18
- # state :string(255)
19
18
  # required_score :integer default(0), not null
20
19
  # acquired_at :datetime
21
20
  # bookstore_id :integer
@@ -32,32 +31,32 @@ describe Item do
32
31
  fixtures :all
33
32
 
34
33
  it "should be rent" do
35
- items(:item_00001).rent?.should be_true
34
+ items(:item_00001).rent?.should be_truthy
36
35
  end
37
36
 
38
37
  it "should not be rent" do
39
- items(:item_00010).rent?.should be_false
38
+ items(:item_00010).rent?.should be_falsy
40
39
  end
41
40
 
42
41
  it "should be checked out" do
43
- items(:item_00010).checkout!(users(:admin)).should be_true
42
+ items(:item_00010).checkout!(users(:admin)).should be_truthy
44
43
  items(:item_00010).circulation_status.name.should eq 'On Loan'
45
44
  end
46
45
 
47
46
  it "should be checked in" do
48
- items(:item_00001).checkin!.should be_true
47
+ items(:item_00001).checkin!.should be_truthy
49
48
  items(:item_00001).circulation_status.name.should eq 'Available On Shelf'
50
49
  end
51
50
 
52
51
  it "should be retained" do
53
52
  old_count = MessageRequest.count
54
- items(:item_00013).retain(users(:librarian1)).should be_true
53
+ items(:item_00013).retain(users(:librarian1)).should be_truthy
55
54
  items(:item_00013).reserves.first.state.should eq 'retained'
56
55
  MessageRequest.count.should eq old_count + 4
57
56
  end
58
57
 
59
58
  it "should not be checked out when it is reserved" do
60
- items(:item_00012).available_for_checkout?.should be_false
59
+ items(:item_00012).available_for_checkout?.should be_falsy
61
60
  end
62
61
 
63
62
  it "should have library_url" do
@@ -65,7 +64,7 @@ describe Item do
65
64
  end
66
65
 
67
66
  it "should not be able to checkout a removed item" do
68
- Item.for_checkout.include?(items(:item_00023)).should be_false
67
+ Item.for_checkout.include?(items(:item_00023)).should be_falsy
69
68
  end
70
69
 
71
70
  it "should update lending policies" do
@@ -165,11 +165,11 @@ describe Manifestation, :solr => true do
165
165
  end
166
166
 
167
167
  it "should be reserved" do
168
- manifestations(:manifestation_00007).is_reserved_by?(users(:admin)).should be_true
168
+ manifestations(:manifestation_00007).is_reserved_by?(users(:admin)).should be_truthy
169
169
  end
170
170
 
171
171
  it "should not be reserved" do
172
- manifestations(:manifestation_00007).is_reserved_by?(users(:user1)).should be_false
172
+ manifestations(:manifestation_00007).is_reserved_by?(users(:user1)).should be_falsy
173
173
  end
174
174
 
175
175
  it "should_get_number_of_pages" do
@@ -185,7 +185,7 @@ describe Manifestation, :solr => true do
185
185
  end
186
186
 
187
187
  it "should have parent_of_series" do
188
- manifestations(:manifestation_00001).parent_of_series.should be_true
188
+ manifestations(:manifestation_00001).parent_of_series.should be_truthy
189
189
  end
190
190
 
191
191
  it "should respond to extract_text" do
@@ -193,11 +193,11 @@ describe Manifestation, :solr => true do
193
193
  end
194
194
 
195
195
  it "should not be reserved it it has no item" do
196
- manifestations(:manifestation_00008).is_reservable_by?(users(:admin)).should be_false
196
+ manifestations(:manifestation_00008).is_reservable_by?(users(:admin)).should be_falsy
197
197
  end
198
198
 
199
199
  it "should respond to title" do
200
- manifestations(:manifestation_00001).title.should be_true
200
+ manifestations(:manifestation_00001).title.should be_truthy
201
201
  end
202
202
 
203
203
  it "should respond to pickup" do
@@ -205,7 +205,7 @@ describe Manifestation, :solr => true do
205
205
  end
206
206
 
207
207
  it "should be periodical if its series_statement is periodical" do
208
- manifestations(:manifestation_00202).periodical?.should be_true
208
+ manifestations(:manifestation_00202).periodical?.should be_truthy
209
209
  end
210
210
 
211
211
  #it "should set series_statement if the manifestation is periodical" do
@@ -219,8 +219,8 @@ describe Manifestation, :solr => true do
219
219
 
220
220
  if defined?(EnjuCirculation)
221
221
  it "should respond to is_checked_out_by?" do
222
- manifestations(:manifestation_00001).is_checked_out_by?(users(:admin)).should be_true
223
- manifestations(:manifestation_00001).is_checked_out_by?(users(:librarian2)).should be_false
222
+ manifestations(:manifestation_00001).is_checked_out_by?(users(:admin)).should be_truthy
223
+ manifestations(:manifestation_00001).is_checked_out_by?(users(:librarian2)).should be_falsy
224
224
  end
225
225
  end
226
226
  end
@@ -259,7 +259,6 @@ end
259
259
  # repository_content :boolean default(FALSE), not null
260
260
  # lock_version :integer default(0), not null
261
261
  # required_role_id :integer default(1), not null
262
- # state :string(255)
263
262
  # required_score :integer default(0), not null
264
263
  # frequency_id :integer default(1), not null
265
264
  # subscription_master :boolean default(FALSE), not null
@@ -289,4 +288,3 @@ end
289
288
  # periodical :boolean
290
289
  # statement_of_responsibility :text
291
290
  #
292
-
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe ResourceExportFile do
5
+ fixtures :all
6
+
7
+ it "should export in background" do
8
+ file = ResourceExportFile.new
9
+ file.user = users(:admin)
10
+ file.save
11
+ ResourceExportFileQueue.perform(file.id).should be_truthy
12
+ end
13
+ end
14
+
15
+ # == Schema Information
16
+ #
17
+ # Table name: resource_export_files
18
+ #
19
+ # id :integer not null, primary key
20
+ # user_id :integer
21
+ # resource_export_file_name :string(255)
22
+ # resource_export_content_type :string(255)
23
+ # resource_export_file_size :integer
24
+ # resource_export_updated_at :datetime
25
+ # executed_at :datetime
26
+ # created_at :datetime not null
27
+ # updated_at :datetime not null
28
+ #
@@ -47,6 +47,8 @@ describe ResourceImportFile do
47
47
  item_10101.manifestation.classifications.first.classification_type.name.should eq 'ndc'
48
48
  item_10101.manifestation.classifications.first.category.should eq '007'
49
49
  item_10101.manifestation.language.name.should eq 'Japanese'
50
+ item_10101.manifestation.statement_of_responsibility.should eq '著者A; 著者B'
51
+
50
52
  item_10102 = Item.where(:item_identifier => '10102').first
51
53
  item_10102.manifestation.date_of_publication.should eq Time.zone.parse('2001-01-01')
52
54
  item_10102.manifestation.language.name.should eq 'Japanese'
@@ -72,8 +74,8 @@ describe ResourceImportFile do
72
74
  manifestation_104.creators.collect(&:full_name).should eq ['test3']
73
75
  manifestation_104.publishers.collect(&:full_name).should eq ['test4']
74
76
 
75
- @file.resource_import_fingerprint.should be_true
76
- @file.executed_at.should be_true
77
+ @file.resource_import_fingerprint.should be_truthy
78
+ @file.executed_at.should be_truthy
77
79
  end
78
80
  end
79
81
 
@@ -107,8 +109,8 @@ describe ResourceImportFile do
107
109
  item.price.should eq 0
108
110
  item.manifestation.publishers.size.should eq 2
109
111
 
110
- @file.resource_import_fingerprint.should be_true
111
- @file.executed_at.should be_true
112
+ @file.resource_import_fingerprint.should be_truthy
113
+ @file.executed_at.should be_truthy
112
114
  end
113
115
  end
114
116
 
@@ -154,6 +156,13 @@ describe ResourceImportFile do
154
156
  Item.count.should eq old_count - 2
155
157
  end
156
158
  end
159
+
160
+ it "should import in background" do
161
+ file = ResourceImportFile.create :resource_import => File.new("#{Rails.root.to_s}/../../examples/resource_import_file_sample1.tsv")
162
+ file.user = users(:admin)
163
+ file.save
164
+ ResourceImportFileQueue.perform(file.id).should be_truthy
165
+ end
157
166
  end
158
167
 
159
168
  # == Schema Information
@@ -167,7 +176,6 @@ end
167
176
  # user_id :integer
168
177
  # note :text
169
178
  # executed_at :datetime
170
- # state :string(255)
171
179
  # resource_import_file_name :string(255)
172
180
  # resource_import_content_type :string(255)
173
181
  # resource_import_file_size :integer
@@ -177,6 +185,7 @@ end
177
185
  # edit_mode :string(255)
178
186
  # resource_import_fingerprint :string(255)
179
187
  # error_message :text
188
+ # user_encoding :string(255)
180
189
  #
181
190
 
182
191
  # == Schema Information
@@ -200,5 +209,6 @@ end
200
209
  # edit_mode :string(255)
201
210
  # resource_import_fingerprint :string(255)
202
211
  # error_message :text
212
+ # user_encoding :string(255)
203
213
  #
204
214
 
@@ -16,7 +16,7 @@ describe ManifestationsController do
16
16
  end
17
17
 
18
18
  it "recognizes ISBN" do
19
- { :get => "/isbn/4798002062" }.should route_to(:controller => "manifestations", :action => "index", :isbn => "4798002062")
19
+ { :get => "/isbn/4798002062" }.should route_to(:controller => "manifestations", :action => "index", :isbn_id => "4798002062")
20
20
  end
21
21
 
22
22
  it "recognizes and generates #edit" do
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe ResourceExportFilesController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/resource_export_files").should route_to("resource_export_files#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/resource_export_files/new").should route_to("resource_export_files#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/resource_export_files/1").should route_to("resource_export_files#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/resource_export_files/1/edit").should route_to("resource_export_files#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/resource_export_files").should route_to("resource_export_files#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/resource_export_files/1").should route_to("resource_export_files#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/resource_export_files/1").should route_to("resource_export_files#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
data/spec/spec_helper.rb CHANGED
@@ -9,6 +9,7 @@ require 'rspec/autorun'
9
9
  require 'vcr'
10
10
  require 'factory_girl'
11
11
  require 'sunspot-rails-tester'
12
+ require 'rspec/active_model/mocks'
12
13
 
13
14
  # Requires supporting ruby files with custom matchers and macros, etc,
14
15
  # in spec/support/ and its subdirectories.
@@ -49,6 +50,8 @@ RSpec.configure do |config|
49
50
  Sunspot.session = $original_sunspot_session
50
51
  Sunspot.remove_all!
51
52
  end
53
+
54
+ config.infer_spec_type_from_file_location!
52
55
  end
53
56
 
54
57
  FactoryGirl.definition_file_paths << "#{::Rails.root}/../../spec/factories"
@@ -0,0 +1,32 @@
1
+ # https://github.com/resque/resque/wiki/RSpec-and-Resque
2
+ RSpec.configure do |config|
3
+ REDIS_PID = "#{Rails.root}/tmp/pids/redis-test.pid"
4
+ REDIS_CACHE_PATH = "#{Rails.root}/tmp/cache/"
5
+
6
+ unless ENV["TRAVIS"]
7
+ config.before(:suite) do
8
+ redis_options = {
9
+ "daemonize" => 'yes',
10
+ "pidfile" => REDIS_PID,
11
+ "port" => 9736,
12
+ "timeout" => 300,
13
+ "save 900" => 1,
14
+ "save 300" => 1,
15
+ "save 60" => 10000,
16
+ "dbfilename" => "dump.rdb",
17
+ "dir" => REDIS_CACHE_PATH,
18
+ "loglevel" => "debug",
19
+ "logfile" => "stdout",
20
+ "databases" => 16
21
+ }.map { |k, v| "#{k} #{v}" }.join("\n")
22
+ `echo '#{redis_options}' | redis-server -`
23
+ end
24
+
25
+ config.after(:suite) do
26
+ %x{
27
+ cat #{REDIS_PID} | xargs kill -QUIT
28
+ rm -f #{REDIS_CACHE_PATH}dump.rdb
29
+ }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe "import_requests/edit" do
4
+ before(:each) do
5
+ @import_request = assign(:import_request, stub_model(ImportRequest,
6
+ :isbn => "1111111111",
7
+ :created_at => Time.zone.now
8
+ ))
9
+ end
10
+
11
+ it "renders the edit import_request form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => import_requests_path(@import_request), :method => "post" do
16
+ assert_select "input#import_request_isbn", :name => "import_request[isbn]"
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe "import_requests/index" do
5
+ fixtures :users
6
+
7
+ before(:each) do
8
+ assign(:import_requests, Kaminari::paginate_array([
9
+ stub_model(ImportRequest,
10
+ :id => 1,
11
+ :isbn => "1111111111",
12
+ :created_at => Time.zone.now,
13
+ :user_id => 1
14
+ ),
15
+ stub_model(ImportRequest,
16
+ :id => 2,
17
+ :isbn => "1111111112",
18
+ :created_at => Time.zone.now,
19
+ :user_id => 2
20
+ )
21
+ ]).page(1))
22
+ end
23
+
24
+ it "renders a list of import_requests" do
25
+ render
26
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
27
+ assert_select "tr>td:nth-child(1)", :text => "1"
28
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
29
+ assert_select "tr>td:nth-child(2)", /admin\n 1111111111\n/
30
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
31
+ assert_select "tr>td:nth-child(3)", :text => localized_state('pending')
32
+ end
33
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe "import_requests/new" do
4
+ before(:each) do
5
+ assign(:import_request, stub_model(ImportRequest,
6
+ :name => "MyString",
7
+ :display_name => "MyText",
8
+ :note => "MyText",
9
+ :position => 1
10
+ ).as_new_record)
11
+ end
12
+
13
+ it "renders new import_request form" do
14
+ render
15
+
16
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
17
+ assert_select "form", :action => import_requests_path, :method => "post" do
18
+ assert_select "input#import_request_isbn", :name => "import_request[isbn]"
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe "import_requests/show" do
4
+ before(:each) do
5
+ @import_request = assign(:import_request, stub_model(ImportRequest,
6
+ :isbn => "1111111111",
7
+ :created_at => Time.zone.now
8
+ ))
9
+ end
10
+
11
+ it "renders attributes in <p>" do
12
+ render
13
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
14
+ rendered.should match(/Id/)
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ rendered.should match(/ISBN/)
17
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
18
+ rendered.should match(localized_state('pending'))
19
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
20
+ rendered.should match(/1/)
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe "resource_export_files/edit" do
4
+ before(:each) do
5
+ @resource_export_file = assign(:resource_export_file, stub_model(ResourceExportFile, user_id: 1))
6
+ view.stub(:current_user).and_return(User.find(1))
7
+ end
8
+
9
+ it "renders the edit resource_export_file form" do
10
+ render
11
+
12
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
13
+ assert_select "form[action=?][method=?]", resource_export_file_path(@resource_export_file), "post" do
14
+ end
15
+ end
16
+ end