enju_event 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/event_import_results_controller.rb +3 -3
  3. data/app/controllers/events_controller.rb +1 -1
  4. data/app/controllers/places_controller.rb +1 -1
  5. data/app/models/event_import_file.rb +5 -9
  6. data/app/models/event_import_result.rb +6 -0
  7. data/app/views/event_categories/_form.html.erb +1 -1
  8. data/app/views/event_import_results/index.text.ruby +5 -0
  9. data/app/views/events/{index.txt.ruby → index.text.ruby} +0 -0
  10. data/config/brakeman.ignore +66 -0
  11. data/lib/enju_event/version.rb +1 -1
  12. data/spec/controllers/events_controller_spec.rb +2 -2
  13. data/spec/dummy/config/initializers/mime_types.rb +1 -0
  14. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +12 -0
  15. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +12 -0
  16. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +12 -0
  17. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +12 -0
  18. data/spec/dummy/db/schema.rb +36 -280
  19. data/spec/system/events_spec.rb +3 -3
  20. data/spec/views/event_import_results/index.text.ruby_spec.rb +22 -0
  21. metadata +296 -350
  22. data/app/views/event_import_results/index.txt.erb +0 -3
  23. data/app/views/events/index.txt.erb +0 -4
  24. data/spec/dummy/db/migrate/032_create_checkins.rb +0 -17
  25. data/spec/dummy/db/migrate/033_create_checkouts.rb +0 -25
  26. data/spec/dummy/db/migrate/035_create_reserves.rb +0 -26
  27. data/spec/dummy/db/migrate/121_create_checked_items.rb +0 -17
  28. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +0 -16
  29. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +0 -16
  30. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +0 -16
  31. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +0 -17
  32. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +0 -25
  33. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +0 -18
  34. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +0 -17
  35. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +0 -15
  36. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +0 -15
  37. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +0 -17
  38. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +0 -17
  39. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +0 -15
  40. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +0 -15
  41. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +0 -17
  42. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +0 -23
  43. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +0 -9
  44. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +0 -9
  45. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +0 -9
  46. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
  47. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
  48. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +0 -5
  49. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +0 -5
  50. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +0 -5
  51. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +0 -8
  52. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +0 -5
  53. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +0 -5
  54. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +0 -18
  55. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +0 -18
  56. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +0 -18
  57. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +0 -18
  58. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +0 -18
  59. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +0 -12
  60. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +0 -6
  61. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +0 -5
  62. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +0 -6
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2019_12_19_122214) do
13
+ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
14
14
 
15
15
  create_table "accepts", force: :cascade do |t|
16
16
  t.integer "basket_id"
@@ -217,17 +217,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
217
217
  t.datetime "updated_at"
218
218
  end
219
219
 
220
- create_table "carrier_type_has_checkout_types", force: :cascade do |t|
221
- t.integer "carrier_type_id", null: false
222
- t.integer "checkout_type_id", null: false
223
- t.text "note"
224
- t.integer "position"
225
- t.datetime "created_at"
226
- t.datetime "updated_at"
227
- t.index ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
228
- t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
229
- end
230
-
231
220
  create_table "carrier_types", force: :cascade do |t|
232
221
  t.string "name", null: false
233
222
  t.text "display_name"
@@ -241,89 +230,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
241
230
  t.datetime "attachment_updated_at"
242
231
  end
243
232
 
244
- create_table "checked_items", force: :cascade do |t|
245
- t.integer "item_id", null: false
246
- t.integer "basket_id", null: false
247
- t.datetime "due_date", null: false
248
- t.datetime "created_at"
249
- t.datetime "updated_at"
250
- t.integer "librarian_id"
251
- t.index ["basket_id"], name: "index_checked_items_on_basket_id"
252
- t.index ["item_id"], name: "index_checked_items_on_item_id"
253
- end
254
-
255
- create_table "checkins", force: :cascade do |t|
256
- t.integer "item_id", null: false
257
- t.integer "librarian_id"
258
- t.integer "basket_id"
259
- t.datetime "created_at"
260
- t.datetime "updated_at"
261
- t.integer "lock_version", default: 0, null: false
262
- t.index ["basket_id"], name: "index_checkins_on_basket_id"
263
- t.index ["item_id"], name: "index_checkins_on_item_id"
264
- t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
265
- end
266
-
267
- create_table "checkout_stat_has_manifestations", force: :cascade do |t|
268
- t.integer "manifestation_checkout_stat_id", null: false
269
- t.integer "manifestation_id", null: false
270
- t.integer "checkouts_count"
271
- t.datetime "created_at"
272
- t.datetime "updated_at"
273
- t.index ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
274
- t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
275
- end
276
-
277
- create_table "checkout_stat_has_users", force: :cascade do |t|
278
- t.integer "user_checkout_stat_id", null: false
279
- t.integer "user_id", null: false
280
- t.integer "checkouts_count", default: 0, null: false
281
- t.datetime "created_at"
282
- t.datetime "updated_at"
283
- t.index ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
284
- t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
285
- end
286
-
287
- create_table "checkout_types", force: :cascade do |t|
288
- t.string "name", null: false
289
- t.text "display_name"
290
- t.text "note"
291
- t.integer "position"
292
- t.datetime "created_at"
293
- t.datetime "updated_at"
294
- t.index ["name"], name: "index_checkout_types_on_name"
295
- end
296
-
297
- create_table "checkouts", force: :cascade do |t|
298
- t.integer "user_id"
299
- t.integer "item_id", null: false
300
- t.integer "checkin_id"
301
- t.integer "librarian_id"
302
- t.integer "basket_id"
303
- t.datetime "due_date"
304
- t.integer "checkout_renewal_count", default: 0, null: false
305
- t.integer "lock_version", default: 0, null: false
306
- t.datetime "created_at"
307
- t.datetime "updated_at"
308
- t.integer "shelf_id"
309
- t.index ["basket_id"], name: "index_checkouts_on_basket_id"
310
- t.index ["checkin_id"], name: "index_checkouts_on_checkin_id"
311
- t.index ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
312
- t.index ["item_id"], name: "index_checkouts_on_item_id"
313
- t.index ["librarian_id"], name: "index_checkouts_on_librarian_id"
314
- t.index ["shelf_id"], name: "index_checkouts_on_shelf_id"
315
- t.index ["user_id"], name: "index_checkouts_on_user_id"
316
- end
317
-
318
- create_table "circulation_statuses", force: :cascade do |t|
319
- t.string "name", null: false
320
- t.text "display_name"
321
- t.text "note"
322
- t.integer "position"
323
- t.datetime "created_at"
324
- t.datetime "updated_at"
325
- end
326
-
327
233
  create_table "colors", force: :cascade do |t|
328
234
  t.integer "library_group_id"
329
235
  t.string "property"
@@ -587,13 +493,25 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
587
493
  t.index ["body"], name: "index_isbn_records_on_body", unique: true
588
494
  end
589
495
 
590
- create_table "item_has_use_restrictions", force: :cascade do |t|
496
+ create_table "item_custom_properties", force: :cascade do |t|
497
+ t.string "name", null: false
498
+ t.text "display_name", null: false
499
+ t.text "note"
500
+ t.integer "position", default: 1, null: false
501
+ t.datetime "created_at", null: false
502
+ t.datetime "updated_at", null: false
503
+ t.index ["name"], name: "index_item_custom_properties_on_name", unique: true
504
+ end
505
+
506
+ create_table "item_custom_values", force: :cascade do |t|
507
+ t.integer "item_custom_property_id", null: false
591
508
  t.integer "item_id", null: false
592
- t.integer "use_restriction_id", null: false
593
- t.datetime "created_at"
594
- t.datetime "updated_at"
595
- t.index ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
596
- t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
509
+ t.text "value"
510
+ t.datetime "created_at", null: false
511
+ t.datetime "updated_at", null: false
512
+ t.index ["item_custom_property_id", "item_id"], name: "index_item_custom_values_on_custom_item_property_and_item_id", unique: true
513
+ t.index ["item_custom_property_id"], name: "index_item_custom_values_on_custom_property_id"
514
+ t.index ["item_id"], name: "index_item_custom_values_on_item_id"
597
515
  end
598
516
 
599
517
  create_table "items", force: :cascade do |t|
@@ -613,8 +531,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
613
531
  t.datetime "acquired_at"
614
532
  t.integer "bookstore_id"
615
533
  t.integer "budget_type_id"
616
- t.integer "circulation_status_id", default: 5, null: false
617
- t.integer "checkout_type_id", default: 1, null: false
618
534
  t.string "binding_item_identifier"
619
535
  t.string "binding_call_number"
620
536
  t.datetime "binded_at"
@@ -622,8 +538,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
622
538
  t.text "memo"
623
539
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
624
540
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
625
- t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
626
- t.index ["circulation_status_id"], name: "index_items_on_circulation_status_id"
627
541
  t.index ["item_identifier"], name: "index_items_on_item_identifier"
628
542
  t.index ["manifestation_id"], name: "index_items_on_manifestation_id"
629
543
  t.index ["required_role_id"], name: "index_items_on_required_role_id"
@@ -739,27 +653,25 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
739
653
  t.datetime "updated_at"
740
654
  end
741
655
 
742
- create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
743
- t.string "to_state"
744
- t.text "metadata", default: "{}"
745
- t.integer "sort_key"
746
- t.integer "manifestation_checkout_stat_id"
747
- t.datetime "created_at"
748
- t.datetime "updated_at"
749
- t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
750
- t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
656
+ create_table "manifestation_custom_properties", force: :cascade do |t|
657
+ t.string "name", null: false
658
+ t.text "display_name", null: false
659
+ t.text "note"
660
+ t.integer "position", default: 1, null: false
661
+ t.datetime "created_at", null: false
662
+ t.datetime "updated_at", null: false
663
+ t.index ["name"], name: "index_manifestation_custom_properties_on_name", unique: true
751
664
  end
752
665
 
753
- create_table "manifestation_checkout_stats", force: :cascade do |t|
754
- t.datetime "start_date"
755
- t.datetime "end_date"
756
- t.text "note"
757
- t.datetime "created_at"
758
- t.datetime "updated_at"
759
- t.datetime "started_at"
760
- t.datetime "completed_at"
761
- t.integer "user_id"
762
- t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
666
+ create_table "manifestation_custom_values", force: :cascade do |t|
667
+ t.integer "manifestation_custom_property_id", null: false
668
+ t.integer "manifestation_id", null: false
669
+ t.text "value"
670
+ t.datetime "created_at", null: false
671
+ t.datetime "updated_at", null: false
672
+ t.index ["manifestation_custom_property_id", "manifestation_id"], name: "index_manifestation_custom_values_on_property_manifestation", unique: true
673
+ t.index ["manifestation_custom_property_id"], name: "index_manifestation_custom_values_on_custom_property_id"
674
+ t.index ["manifestation_id"], name: "index_manifestation_custom_values_on_manifestation_id"
763
675
  end
764
676
 
765
677
  create_table "manifestation_relationship_types", force: :cascade do |t|
@@ -782,29 +694,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
782
694
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
783
695
  end
784
696
 
785
- create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
786
- t.string "to_state"
787
- t.text "metadata", default: "{}"
788
- t.integer "sort_key"
789
- t.integer "manifestation_reserve_stat_id"
790
- t.datetime "created_at"
791
- t.datetime "updated_at"
792
- t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
793
- t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
794
- end
795
-
796
- create_table "manifestation_reserve_stats", force: :cascade do |t|
797
- t.datetime "start_date"
798
- t.datetime "end_date"
799
- t.text "note"
800
- t.datetime "created_at"
801
- t.datetime "updated_at"
802
- t.datetime "started_at"
803
- t.datetime "completed_at"
804
- t.integer "user_id"
805
- t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
806
- end
807
-
808
697
  create_table "manifestations", force: :cascade do |t|
809
698
  t.text "original_title", null: false
810
699
  t.text "title_alternative"
@@ -1042,12 +931,9 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1042
931
  t.integer "required_role_id"
1043
932
  t.datetime "created_at"
1044
933
  t.datetime "updated_at"
1045
- t.string "checkout_icalendar_token"
1046
- t.boolean "save_checkout_history", default: false, null: false
1047
934
  t.datetime "expired_at"
1048
935
  t.text "full_name_transcription"
1049
936
  t.datetime "date_of_birth"
1050
- t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
1051
937
  t.index ["library_id"], name: "index_profiles_on_library_id"
1052
938
  t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
1053
939
  t.index ["user_id"], name: "index_profiles_on_user_id"
@@ -1093,59 +979,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1093
979
  t.datetime "updated_at"
1094
980
  end
1095
981
 
1096
- create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1097
- t.integer "manifestation_reserve_stat_id", null: false
1098
- t.integer "manifestation_id", null: false
1099
- t.integer "reserves_count"
1100
- t.datetime "created_at"
1101
- t.datetime "updated_at"
1102
- t.index ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1103
- t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1104
- end
1105
-
1106
- create_table "reserve_stat_has_users", force: :cascade do |t|
1107
- t.integer "user_reserve_stat_id", null: false
1108
- t.integer "user_id", null: false
1109
- t.integer "reserves_count"
1110
- t.datetime "created_at"
1111
- t.datetime "updated_at"
1112
- t.index ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1113
- t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1114
- end
1115
-
1116
- create_table "reserve_transitions", force: :cascade do |t|
1117
- t.string "to_state"
1118
- t.text "metadata", default: "{}"
1119
- t.integer "sort_key"
1120
- t.integer "reserve_id"
1121
- t.datetime "created_at"
1122
- t.datetime "updated_at"
1123
- t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1124
- t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1125
- end
1126
-
1127
- create_table "reserves", force: :cascade do |t|
1128
- t.integer "user_id", null: false
1129
- t.integer "manifestation_id", null: false
1130
- t.integer "item_id"
1131
- t.integer "request_status_type_id", null: false
1132
- t.datetime "checked_out_at"
1133
- t.datetime "created_at"
1134
- t.datetime "updated_at"
1135
- t.datetime "canceled_at"
1136
- t.datetime "expired_at"
1137
- t.datetime "deleted_at"
1138
- t.boolean "expiration_notice_to_patron", default: false
1139
- t.boolean "expiration_notice_to_library", default: false
1140
- t.datetime "retained_at"
1141
- t.datetime "postponed_at"
1142
- t.integer "lock_version", default: 0, null: false
1143
- t.index ["item_id"], name: "index_reserves_on_item_id"
1144
- t.index ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1145
- t.index ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1146
- t.index ["user_id"], name: "index_reserves_on_user_id"
1147
- end
1148
-
1149
982
  create_table "resource_export_file_transitions", force: :cascade do |t|
1150
983
  t.string "to_state"
1151
984
  t.text "metadata", default: "{}"
@@ -1319,38 +1152,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1319
1152
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1320
1153
  end
1321
1154
 
1322
- create_table "use_restrictions", force: :cascade do |t|
1323
- t.string "name", null: false
1324
- t.text "display_name"
1325
- t.text "note"
1326
- t.integer "position"
1327
- t.datetime "created_at"
1328
- t.datetime "updated_at"
1329
- end
1330
-
1331
- create_table "user_checkout_stat_transitions", force: :cascade do |t|
1332
- t.string "to_state"
1333
- t.text "metadata", default: "{}"
1334
- t.integer "sort_key"
1335
- t.integer "user_checkout_stat_id"
1336
- t.datetime "created_at"
1337
- t.datetime "updated_at"
1338
- t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1339
- t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1340
- end
1341
-
1342
- create_table "user_checkout_stats", force: :cascade do |t|
1343
- t.datetime "start_date"
1344
- t.datetime "end_date"
1345
- t.text "note"
1346
- t.datetime "created_at"
1347
- t.datetime "updated_at"
1348
- t.datetime "started_at"
1349
- t.datetime "completed_at"
1350
- t.integer "user_id"
1351
- t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1352
- end
1353
-
1354
1155
  create_table "user_export_file_transitions", force: :cascade do |t|
1355
1156
  t.string "to_state"
1356
1157
  t.text "metadata", default: "{}"
@@ -1377,25 +1178,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1377
1178
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
1378
1179
  end
1379
1180
 
1380
- create_table "user_group_has_checkout_types", force: :cascade do |t|
1381
- t.integer "user_group_id", null: false
1382
- t.integer "checkout_type_id", null: false
1383
- t.integer "checkout_limit", default: 0, null: false
1384
- t.integer "checkout_period", default: 0, null: false
1385
- t.integer "checkout_renewal_limit", default: 0, null: false
1386
- t.integer "reservation_limit", default: 0, null: false
1387
- t.integer "reservation_expired_period", default: 7, null: false
1388
- t.boolean "set_due_date_before_closing_day", default: false, null: false
1389
- t.datetime "fixed_due_date"
1390
- t.text "note"
1391
- t.integer "position"
1392
- t.datetime "created_at"
1393
- t.datetime "updated_at"
1394
- t.integer "current_checkout_count"
1395
- t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1396
- t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1397
- end
1398
-
1399
1181
  create_table "user_groups", force: :cascade do |t|
1400
1182
  t.string "name"
1401
1183
  t.text "display_name"
@@ -1463,29 +1245,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1463
1245
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1464
1246
  end
1465
1247
 
1466
- create_table "user_reserve_stat_transitions", force: :cascade do |t|
1467
- t.string "to_state"
1468
- t.text "metadata", default: "{}"
1469
- t.integer "sort_key"
1470
- t.integer "user_reserve_stat_id"
1471
- t.datetime "created_at"
1472
- t.datetime "updated_at"
1473
- t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1474
- t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1475
- end
1476
-
1477
- create_table "user_reserve_stats", force: :cascade do |t|
1478
- t.datetime "start_date"
1479
- t.datetime "end_date"
1480
- t.text "note"
1481
- t.datetime "created_at"
1482
- t.datetime "updated_at"
1483
- t.datetime "started_at"
1484
- t.datetime "completed_at"
1485
- t.integer "user_id"
1486
- t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1487
- end
1488
-
1489
1248
  create_table "users", force: :cascade do |t|
1490
1249
  t.string "email", default: "", null: false
1491
1250
  t.string "encrypted_password", default: "", null: false
@@ -1499,8 +1258,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1499
1258
  t.string "last_sign_in_ip"
1500
1259
  t.datetime "created_at"
1501
1260
  t.datetime "updated_at"
1502
- t.boolean "save_checkout_history", default: false, null: false
1503
- t.string "checkout_icalendar_token"
1504
1261
  t.string "username"
1505
1262
  t.datetime "deleted_at"
1506
1263
  t.datetime "expired_at"
@@ -1508,7 +1265,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1508
1265
  t.string "unlock_token"
1509
1266
  t.datetime "locked_at"
1510
1267
  t.datetime "confirmed_at"
1511
- t.index ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1512
1268
  t.index ["email"], name: "index_users_on_email"
1513
1269
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1514
1270
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
@@ -14,9 +14,9 @@ RSpec.describe 'Events', type: :system do
14
14
  expect(page).to have_link 'Kamata Library', href: events_path(library_id: 'kamata', query: 'test')
15
15
  end
16
16
 
17
- it 'should export events in txt format' do
18
- visit events_path(format: :txt)
19
- expect(page).to have_content 'Kamata Library'
17
+ it 'should export events in text format' do
18
+ visit events_path(format: :text)
19
+ expect(page).to have_content 'kamata'
20
20
  end
21
21
  end
22
22
  end
@@ -0,0 +1,22 @@
1
+ require 'rails_helper'
2
+
3
+ describe "event_import_results/index.text.ruby" do
4
+ fixtures :all
5
+
6
+ before(:each) do
7
+ file = EventImportFile.create!(
8
+ event_import: File.new("#{Rails.root.to_s}/../../examples/event_import_file_sample1.tsv"),
9
+ default_library_id: 3,
10
+ default_event_category: EventCategory.find(3),
11
+ user: users(:admin)
12
+ )
13
+ file.import_start
14
+ assign(:event_import_file_id, file.id)
15
+ assign(:event_import_results, EventImportFile.find(file.id).event_import_results)
16
+ end
17
+
18
+ it "renders a list of event_import_results" do
19
+ render
20
+ expect(CSV.parse(rendered, headers: true, col_sep: "\t").first['library']).to eq 'hachioji'
21
+ end
22
+ end