enju_circulation 0.3.9 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/checkins_controller.rb +2 -2
  4. data/app/controllers/user_group_has_checkout_types_controller.rb +1 -1
  5. data/app/helpers/items_helper.rb +3 -3
  6. data/app/models/checked_item.rb +7 -17
  7. data/app/models/checkin.rb +3 -2
  8. data/app/models/checkout.rb +2 -2
  9. data/app/models/checkout_stat_has_user.rb +1 -1
  10. data/app/models/checkout_type.rb +9 -7
  11. data/app/models/circulation_status.rb +9 -8
  12. data/app/models/concerns/enju_circulation/enju_item.rb +2 -46
  13. data/app/models/concerns/enju_circulation/enju_user_group.rb +0 -1
  14. data/app/models/concerns/enju_circulation/enju_withdraw.rb +1 -7
  15. data/app/models/manifestation_checkout_stat_transition.rb +1 -1
  16. data/app/models/manifestation_reserve_stat_transition.rb +1 -1
  17. data/app/models/reserve.rb +5 -5
  18. data/app/models/reserve_state_machine.rb +3 -2
  19. data/app/models/reserve_transition.rb +1 -1
  20. data/app/models/retain.rb +15 -0
  21. data/app/models/user_checkout_stat_transition.rb +1 -1
  22. data/app/models/user_group_has_checkout_type.rb +15 -37
  23. data/app/models/user_reserve_stat_transition.rb +1 -1
  24. data/app/views/carrier_type_has_checkout_types/_form.html.erb +2 -2
  25. data/app/views/carrier_type_has_checkout_types/index.html.erb +2 -2
  26. data/app/views/carrier_type_has_checkout_types/show.html.erb +2 -2
  27. data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +1 -1
  28. data/app/views/checked_items/new.html.erb +1 -1
  29. data/app/views/checkins/_checkin.html.erb +1 -1
  30. data/app/views/checkout_types/_form.html.erb +1 -1
  31. data/app/views/checkout_types/index.html.erb +1 -1
  32. data/app/views/checkout_types/show.html.erb +2 -2
  33. data/app/views/checkouts/_index_user.html.erb +1 -1
  34. data/app/views/checkouts/_list.html.erb +2 -9
  35. data/app/views/checkouts/index.atom.builder +1 -1
  36. data/app/views/checkouts/index.ics.erb +1 -1
  37. data/app/views/checkouts/index.rss.builder +1 -1
  38. data/app/views/circulation_statuses/_form.html.erb +1 -1
  39. data/app/views/circulation_statuses/index.html.erb +1 -1
  40. data/app/views/circulation_statuses/show.html.erb +1 -1
  41. data/app/views/item_has_use_restrictions/index.html.erb +1 -1
  42. data/app/views/item_has_use_restrictions/show.html.erb +1 -1
  43. data/app/views/manifestation_checkout_stats/_group_by_carrier_type.html.erb +3 -3
  44. data/app/views/manifestation_checkout_stats/_group_by_checkout_type.html.erb +3 -3
  45. data/app/views/manifestations/_circulation_status.html.erb +3 -3
  46. data/app/views/profiles/_submenu_checkout.html.erb +1 -1
  47. data/app/views/reserves/_new.html.erb +1 -1
  48. data/app/views/reserves/_new_user.html.erb +1 -1
  49. data/app/views/reserves/edit.html.erb +1 -1
  50. data/app/views/reserves/index.atom.builder +1 -1
  51. data/app/views/reserves/index.html.erb +1 -1
  52. data/app/views/reserves/index.rss.builder +1 -1
  53. data/app/views/reserves/show.html.erb +1 -1
  54. data/app/views/use_restrictions/_form.html.erb +1 -1
  55. data/app/views/use_restrictions/index.html.erb +1 -1
  56. data/app/views/use_restrictions/show.html.erb +1 -1
  57. data/app/views/user_group_has_checkout_types/edit.html.erb +4 -4
  58. data/app/views/user_group_has_checkout_types/index.html.erb +2 -2
  59. data/app/views/user_group_has_checkout_types/new.html.erb +4 -4
  60. data/app/views/user_group_has_checkout_types/show.html.erb +4 -4
  61. data/app/views/user_groups/_user_group_has_checkout_type_fields.html.erb +2 -2
  62. data/config/locales/translation_en.yml +1 -14
  63. data/config/locales/translation_ja.yml +1 -14
  64. data/config/routes.rb +1 -2
  65. data/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +3 -3
  66. data/db/migrate/20190508160525_create_retains.rb +10 -0
  67. data/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
  68. data/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  69. data/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +5 -0
  70. data/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
  71. data/lib/enju_circulation/version.rb +1 -1
  72. data/lib/generators/enju_circulation/setup/templates/db/fixtures/checkout_types.yml +3 -5
  73. data/lib/generators/enju_circulation/setup/templates/db/fixtures/circulation_statuses.yml +16 -48
  74. data/lib/tasks/enju_circulation_tasks.rake +7 -1
  75. data/spec/concerns/enju_accept_spec.rb +14 -14
  76. data/spec/controllers/accepts_controller_spec.rb +294 -0
  77. data/spec/controllers/baskets_controller_spec.rb +379 -0
  78. data/spec/controllers/checkins_controller_spec.rb +8 -130
  79. data/spec/controllers/items_controller_spec.rb +23 -43
  80. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  81. data/spec/dummy/app/models/user.rb +1 -1
  82. data/spec/dummy/bin/bundle +1 -1
  83. data/spec/dummy/bin/setup +1 -3
  84. data/spec/dummy/bin/update +4 -2
  85. data/spec/dummy/bin/yarn +3 -3
  86. data/spec/dummy/config/database.yml +70 -9
  87. data/spec/dummy/config/initializers/assets.rb +1 -0
  88. data/spec/dummy/db/development.sqlite3 +0 -0
  89. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  90. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  91. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  92. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  93. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  94. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  95. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  96. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  97. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  98. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  99. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  100. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  101. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  102. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  103. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  104. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  105. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  106. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  107. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  108. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  109. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  110. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  111. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  112. data/spec/dummy/db/schema.rb +221 -184
  113. data/spec/dummy/db/test.sqlite3 +0 -0
  114. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/original/book.png +0 -0
  115. data/spec/dummy/private/system/carrier_types/attachments/000/000/001/thumb/book.png +0 -0
  116. data/spec/factories/accept.rb +1 -1
  117. data/spec/factories/item.rb +4 -4
  118. data/spec/factories/reserve.rb +1 -5
  119. data/spec/fixtures/carrier_types.yml +16 -15
  120. data/spec/fixtures/checkins.yml +2 -1
  121. data/spec/fixtures/checkout_stat_has_users.yml +1 -1
  122. data/spec/fixtures/checkout_types.yml +11 -10
  123. data/spec/fixtures/checkouts.yml +2 -2
  124. data/spec/fixtures/circulation_statuses.yml +26 -34
  125. data/spec/fixtures/content_types.yml +20 -31
  126. data/spec/fixtures/event_categories.yml +23 -23
  127. data/spec/fixtures/frequencies.yml +17 -25
  128. data/spec/fixtures/items.yml +1 -1
  129. data/spec/fixtures/libraries.yml +30 -31
  130. data/spec/fixtures/library_groups.yml +43 -20
  131. data/spec/fixtures/request_status_types.yml +14 -14
  132. data/spec/fixtures/request_types.yml +13 -13
  133. data/spec/fixtures/reserve_transitions.yml +1 -1
  134. data/spec/fixtures/reserves.yml +3 -3
  135. data/spec/fixtures/roles.yml +22 -5
  136. data/spec/fixtures/shelves.yml +16 -15
  137. data/spec/fixtures/user_group_has_checkout_types.yml +24 -24
  138. data/spec/fixtures/user_groups.yml +23 -3
  139. data/spec/helpers/items_helper_spec.rb +1 -1
  140. data/spec/models/checkin_spec.rb +2 -1
  141. data/spec/models/checkout_spec.rb +2 -2
  142. data/spec/models/checkout_stat_has_user_spec.rb +1 -1
  143. data/spec/models/checkout_type_spec.rb +8 -7
  144. data/spec/models/circulation_status_spec.rb +8 -7
  145. data/spec/models/item_spec.rb +6 -8
  146. data/spec/models/manifestation_spec.rb +15 -18
  147. data/spec/models/reserve_spec.rb +3 -3
  148. data/spec/models/resource_export_file_spec.rb +0 -15
  149. data/spec/models/retain_spec.rb +16 -0
  150. data/spec/models/user_group_has_checkout_type_spec.rb +15 -32
  151. data/spec/models/withdraw_spec.rb +4 -6
  152. data/spec/policies/manifestation_policy_spec.rb +2 -1
  153. data/spec/rails_helper.rb +10 -3
  154. data/spec/views/items/index.html.erb_spec.rb +1 -4
  155. metadata +396 -446
  156. data/app/controllers/lending_policies_controller.rb +0 -106
  157. data/app/models/lending_policy.rb +0 -30
  158. data/app/views/lending_policies/_form.html.erb +0 -41
  159. data/app/views/lending_policies/edit.html.erb +0 -13
  160. data/app/views/lending_policies/index.html.erb +0 -42
  161. data/app/views/lending_policies/new.html.erb +0 -12
  162. data/app/views/lending_policies/show.html.erb +0 -50
  163. data/db/migrate/20090831220301_create_lending_policies.rb +0 -21
  164. data/spec/controllers/lending_policies_controller_spec.rb +0 -444
  165. data/spec/controllers/withdraws_controller_spec.rb +0 -26
  166. data/spec/dummy/config/locales/en.yml +0 -208
  167. data/spec/dummy/config/locales/ja.yml +0 -200
  168. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  169. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  170. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  171. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  172. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  173. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  174. data/spec/fixtures/accepts.yml +0 -9
  175. data/spec/fixtures/bookstores.yml +0 -99
  176. data/spec/fixtures/budget_types.yml +0 -30
  177. data/spec/fixtures/exemplifies.yml +0 -168
  178. data/spec/fixtures/lending_policies.yml +0 -98
  179. data/spec/models/lending_policy_spec.rb +0 -23
  180. data/spec/system/items_spec.rb +0 -21
  181. data/spec/system/user_group_has_checkout_types.rb +0 -14
@@ -1,21 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe 'Checkouts', type: :system do
4
- include Devise::Test::IntegrationHelpers
5
- fixtures :all
6
-
7
- before(:each) do
8
- CarrierType.find_by(name: 'volume').update(attachment: File.open("#{Rails.root.to_s}/app/assets/images/icons/book.png"))
9
- end
10
-
11
- describe 'When logged in as Librarian' do
12
- it 'should not set "Removed" as circulation status if the item is reserved' do
13
- item = FactoryBot.create(:reserve).item
14
- sign_in users(:librarian1)
15
- visit edit_item_path(item)
16
- select('除籍済み', from: 'item_circulation_status_id')
17
- click_button('更新する')
18
- expect(page).to have_content 'この貸出状態には変更できません。資料が予約されています。'
19
- end
20
- end
21
- end
@@ -1,14 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe 'UserGroupHasCheckoutType', type: :system do
4
- include Devise::Test::IntegrationHelpers
5
- fixtures :all
6
-
7
- describe 'When logged in as Librarian' do
8
- it 'should render' do
9
- sign_in users(:librarian1)
10
- visit edit_user_group_has_checkout_path(user_group_has_checkout_types(:user_group_has_checkout_type_00001))
11
- expect(page).to have_field :user_group_id
12
- end
13
- end
14
- end