enju_library 0.4.0.beta.4 → 0.4.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/controllers/library_groups_controller.rb +1 -4
  4. data/app/helpers/enju_library/application_helper.rb +2 -2
  5. data/app/mailers/notifier.rb +2 -2
  6. data/app/mailers/user_export_mailer.rb +2 -2
  7. data/app/mailers/user_import_mailer.rb +2 -2
  8. data/app/models/accept.rb +6 -6
  9. data/app/models/basket.rb +4 -4
  10. data/app/models/bookstore.rb +3 -4
  11. data/app/models/budget_type.rb +3 -3
  12. data/app/models/color.rb +4 -4
  13. data/app/models/concerns/enju_library/enju_user.rb +62 -0
  14. data/app/models/library.rb +5 -6
  15. data/app/models/library_group.rb +5 -4
  16. data/app/models/request_status_type.rb +3 -3
  17. data/app/models/request_type.rb +3 -3
  18. data/app/models/search_engine.rb +3 -3
  19. data/app/models/shelf.rb +5 -6
  20. data/app/models/subscribe.rb +4 -4
  21. data/app/models/subscription.rb +5 -6
  22. data/app/models/user_export_file.rb +14 -20
  23. data/app/models/user_export_file_state_machine.rb +1 -1
  24. data/app/models/user_export_file_transition.rb +4 -4
  25. data/app/models/user_group.rb +3 -4
  26. data/app/models/user_import_file.rb +13 -21
  27. data/app/models/user_import_file_state_machine.rb +1 -1
  28. data/app/models/user_import_file_transition.rb +4 -4
  29. data/app/models/user_import_result.rb +5 -5
  30. data/app/models/withdraw.rb +4 -10
  31. data/app/policies/shelf_policy.rb +1 -1
  32. data/app/views/layouts/libraries.html.erb +31 -0
  33. data/app/views/libraries/_map.html.erb +8 -24
  34. data/app/views/libraries/_map_header.html.erb +6 -0
  35. data/app/views/library_groups/_form.html.erb +1 -3
  36. data/app/views/library_groups/show.html.erb +1 -1
  37. data/app/views/user_groups/show.html.erb +5 -3
  38. data/app/views/user_import_files/_results.html.erb +5 -0
  39. data/app/views/user_import_results/index.html.erb +0 -11
  40. data/db/migrate/059_create_libraries.rb +1 -2
  41. data/db/migrate/069_create_shelves.rb +1 -2
  42. data/db/migrate/077_create_user_groups.rb +1 -2
  43. data/db/migrate/080_create_library_groups.rb +1 -1
  44. data/db/migrate/120_create_baskets.rb +1 -1
  45. data/db/migrate/124_create_bookstores.rb +1 -2
  46. data/db/migrate/130_create_request_status_types.rb +1 -1
  47. data/db/migrate/131_create_request_types.rb +1 -1
  48. data/db/migrate/20081006090811_create_subscriptions.rb +1 -2
  49. data/db/migrate/20081006093246_create_subscribes.rb +1 -1
  50. data/db/migrate/20081023092436_create_search_engines.rb +1 -1
  51. data/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  52. data/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  53. data/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
  54. data/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
  55. data/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  56. data/db/migrate/20120129014038_create_budget_types.rb +1 -1
  57. data/db/migrate/20120319173203_create_accepts.rb +1 -1
  58. data/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
  59. data/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  60. data/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  61. data/db/migrate/20140110131010_create_user_import_results.rb +1 -1
  62. data/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -1
  63. data/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  64. data/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  65. data/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
  66. data/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  67. data/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  68. data/db/migrate/20140821151023_create_colors.rb +1 -1
  69. data/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  70. data/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  71. data/db/migrate/20150924115059_create_withdraws.rb +1 -1
  72. data/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  73. data/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  74. data/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  75. data/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  76. data/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  77. data/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  78. data/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  79. data/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
  80. data/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
  81. data/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
  82. data/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
  83. data/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
  84. data/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  85. data/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  86. data/db/migrate/20191216131755_add_email_to_library_group.rb +6 -0
  87. data/lib/enju_library/version.rb +1 -1
  88. data/lib/generators/enju_library/setup/setup_generator.rb +4 -3
  89. data/lib/generators/enju_library/setup/templates/db/fixtures/library_groups.yml +2 -2
  90. data/lib/generators/enju_library/setup/templates/db/fixtures/search_engines.yml +9 -0
  91. data/spec/dummy/app/assets/config/manifest.js +2 -0
  92. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  93. data/spec/dummy/app/models/user.rb +0 -2
  94. data/spec/dummy/config/initializers/assets.rb +1 -1
  95. data/spec/dummy/db/migrate/001_create_agents.rb +0 -1
  96. data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -1
  97. data/spec/dummy/db/migrate/006_create_items.rb +0 -1
  98. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  99. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  100. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  101. data/spec/dummy/db/schema.rb +98 -90
  102. data/spec/dummy/db/test.sqlite3 +0 -0
  103. data/spec/dummy/postcss.config.js +12 -0
  104. data/spec/factories/accepts.rb +6 -6
  105. data/spec/factories/budget_types.rb +3 -3
  106. data/spec/fixtures/baskets.yml +4 -4
  107. data/spec/fixtures/bookstores.yml +3 -11
  108. data/spec/fixtures/budget_types.yml +3 -3
  109. data/spec/fixtures/colors.yml +4 -4
  110. data/spec/fixtures/events.yml +0 -9
  111. data/spec/fixtures/libraries.yml +5 -6
  112. data/spec/fixtures/library_groups.yml +6 -5
  113. data/spec/fixtures/request_status_types.yml +3 -3
  114. data/spec/fixtures/request_types.yml +3 -3
  115. data/spec/fixtures/search_engines.yml +3 -3
  116. data/spec/fixtures/shelves.yml +4 -5
  117. data/spec/fixtures/subscribes.yml +4 -4
  118. data/spec/fixtures/subscriptions.yml +5 -6
  119. data/spec/fixtures/user_export_files.yml +4 -4
  120. data/spec/fixtures/user_groups.yml +3 -4
  121. data/spec/fixtures/user_import_files.yml +6 -6
  122. data/spec/fixtures/user_import_results.yml +5 -5
  123. data/spec/fixtures/withdraws.yml +4 -4
  124. data/spec/models/accept_spec.rb +6 -6
  125. data/spec/models/basket_spec.rb +4 -4
  126. data/spec/models/bookstore_spec.rb +3 -4
  127. data/spec/models/budget_type_spec.rb +3 -3
  128. data/spec/models/library_group_spec.rb +5 -4
  129. data/spec/models/library_spec.rb +5 -6
  130. data/spec/models/request_status_type_spec.rb +3 -3
  131. data/spec/models/request_type_spec.rb +3 -3
  132. data/spec/models/search_engine_spec.rb +3 -3
  133. data/spec/models/shelf_spec.rb +4 -5
  134. data/spec/models/subscribe_spec.rb +4 -4
  135. data/spec/models/subscription_spec.rb +5 -6
  136. data/spec/models/user_export_file_spec.rb +4 -4
  137. data/spec/models/user_group_spec.rb +3 -4
  138. data/spec/models/user_import_file_spec.rb +8 -8
  139. data/spec/models/user_import_result_spec.rb +5 -5
  140. data/spec/models/withdraw_spec.rb +4 -4
  141. data/spec/system/libraries_spec.rb +5 -5
  142. data/spec/system/user_groups_spec.rb +46 -0
  143. metadata +32 -18
@@ -0,0 +1,46 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe 'UserGroups', type: :system do
4
+ include Devise::Test::IntegrationHelpers
5
+ fixtures :all
6
+
7
+ describe 'When logged in as Administrator' do
8
+ before do
9
+ sign_in users(:admin)
10
+ end
11
+
12
+ it 'should show user_group config' do
13
+ visit user_group_path(user_groups(:user_group_00002).id, locale: :ja)
14
+ expect(page).to have_content '編集'
15
+ end
16
+ end
17
+
18
+ describe 'When logged in as Librarian' do
19
+ before do
20
+ sign_in users(:librarian1)
21
+ end
22
+
23
+ it 'should not show user_group config' do
24
+ visit user_group_path(user_groups(:user_group_00002).id, locale: :ja)
25
+ expect(page).not_to have_content '編集'
26
+ end
27
+ end
28
+
29
+ describe 'When logged in as User' do
30
+ before do
31
+ sign_in users(:user1)
32
+ end
33
+
34
+ it 'should not show user_group config' do
35
+ visit user_group_path(user_groups(:user_group_00002).id, locale: :ja)
36
+ expect(page).not_to have_content '編集'
37
+ end
38
+ end
39
+
40
+ describe 'When not logged in' do
41
+ it 'should not show user_group config' do
42
+ visit user_group_path(user_groups(:user_group_00002).id, locale: :ja)
43
+ expect(page).not_to have_content '編集'
44
+ end
45
+ end
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta.4
4
+ version: 0.4.0.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2020-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_seed
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.0.beta.3
19
+ version: 0.4.0.rc.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.0.beta.3
26
+ version: 0.4.0.rc.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: geocoder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: '6.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '5.0'
54
+ version: '6.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mini_magick
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,42 +100,42 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.0.0.beta.1
103
+ version: 2.0.0.rc.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.0.0.beta.1
110
+ version: 2.0.0.rc.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: enju_manifestation_viewer
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.4.0.beta.1
117
+ version: 0.4.0.rc.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.4.0.beta.1
124
+ version: 0.4.0.rc.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: enju_message
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.4.0.beta.2
131
+ version: 0.4.0.rc.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.4.0.beta.2
138
+ version: 0.4.0.rc.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: pg
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '3.8'
159
+ version: '3.9'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '3.8'
166
+ version: '3.9'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: factory_bot_rails
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -252,16 +252,16 @@ dependencies:
252
252
  name: capybara
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - "~>"
255
+ - - ">="
256
256
  - !ruby/object:Gem::Version
257
- version: '3.11'
257
+ version: '0'
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - "~>"
262
+ - - ">="
263
263
  - !ruby/object:Gem::Version
264
- version: '3.11'
264
+ version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: selenium-webdriver
267
267
  requirement: !ruby/object:Gem::Requirement
@@ -408,10 +408,12 @@ files:
408
408
  - app/views/budget_types/index.html.erb
409
409
  - app/views/budget_types/new.html.erb
410
410
  - app/views/budget_types/show.html.erb
411
+ - app/views/layouts/libraries.html.erb
411
412
  - app/views/libraries/_calendar.html.erb
412
413
  - app/views/libraries/_form.html.erb
413
414
  - app/views/libraries/_map.html+phone.erb
414
415
  - app/views/libraries/_map.html.erb
416
+ - app/views/libraries/_map_header.html.erb
415
417
  - app/views/libraries/edit.html.erb
416
418
  - app/views/libraries/index.html.erb
417
419
  - app/views/libraries/new.html.erb
@@ -548,6 +550,7 @@ files:
548
550
  - db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb
549
551
  - db/migrate/20190630113817_add_display_name_translations_to_library_group.rb
550
552
  - db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb
553
+ - db/migrate/20191216131755_add_email_to_library_group.rb
551
554
  - lib/enju_library.rb
552
555
  - lib/enju_library/engine.rb
553
556
  - lib/enju_library/version.rb
@@ -560,6 +563,7 @@ files:
560
563
  - lib/generators/enju_library/setup/templates/db/fixtures/library_groups.yml
561
564
  - lib/generators/enju_library/setup/templates/db/fixtures/request_status_types.yml
562
565
  - lib/generators/enju_library/setup/templates/db/fixtures/request_types.yml
566
+ - lib/generators/enju_library/setup/templates/db/fixtures/search_engines.yml
563
567
  - lib/generators/enju_library/setup/templates/db/fixtures/user_groups.yml
564
568
  - lib/tasks/color.rb
565
569
  - lib/tasks/enju_library_tasks.rake
@@ -879,8 +883,12 @@ files:
879
883
  - spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb
880
884
  - spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb
881
885
  - spec/dummy/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb
886
+ - spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb
887
+ - spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb
888
+ - spec/dummy/db/migrate/20191219122214_create_custom_properties.rb
882
889
  - spec/dummy/db/schema.rb
883
890
  - spec/dummy/db/test.sqlite3
891
+ - spec/dummy/postcss.config.js
884
892
  - spec/dummy/public/404.html
885
893
  - spec/dummy/public/422.html
886
894
  - spec/dummy/public/500.html
@@ -982,6 +990,7 @@ files:
982
990
  - spec/support/devise.rb
983
991
  - spec/system/libraries_spec.rb
984
992
  - spec/system/shelves_spec.rb
993
+ - spec/system/user_groups_spec.rb
985
994
  - spec/views/accepts/edit.html.erb_spec.rb
986
995
  - spec/views/accepts/index.html.erb_spec.rb
987
996
  - spec/views/accepts/new.html.erb_spec.rb
@@ -1196,6 +1205,7 @@ test_files:
1196
1205
  - spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb
1197
1206
  - spec/dummy/db/migrate/20100129142347_create_import_requests.rb
1198
1207
  - spec/dummy/db/migrate/125_create_donates.rb
1208
+ - spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb
1199
1209
  - spec/dummy/db/migrate/20180107162029_add_constraints_to_most_recent_for_manifestation_checkout_stat_transitions.rb
1200
1210
  - spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb
1201
1211
  - spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb
@@ -1261,6 +1271,7 @@ test_files:
1261
1271
  - spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb
1262
1272
  - spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb
1263
1273
  - spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb
1274
+ - spec/dummy/db/migrate/20191219122214_create_custom_properties.rb
1264
1275
  - spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb
1265
1276
  - spec/dummy/db/migrate/117_create_form_of_works.rb
1266
1277
  - spec/dummy/db/migrate/20080819181903_create_message_requests.rb
@@ -1309,6 +1320,7 @@ test_files:
1309
1320
  - spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb
1310
1321
  - spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb
1311
1322
  - spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb
1323
+ - spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb
1312
1324
  - spec/dummy/db/migrate/145_create_subject_heading_types.rb
1313
1325
  - spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb
1314
1326
  - spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb
@@ -1326,6 +1338,7 @@ test_files:
1326
1338
  - spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb
1327
1339
  - spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb
1328
1340
  - spec/dummy/db/development.sqlite3
1341
+ - spec/dummy/postcss.config.js
1329
1342
  - spec/dummy/README.rdoc
1330
1343
  - spec/mailers/user_export_spec.rb
1331
1344
  - spec/mailers/user_import_spec.rb
@@ -1349,6 +1362,7 @@ test_files:
1349
1362
  - spec/models/accept_spec.rb
1350
1363
  - spec/models/basket_spec.rb
1351
1364
  - spec/system/libraries_spec.rb
1365
+ - spec/system/user_groups_spec.rb
1352
1366
  - spec/system/shelves_spec.rb
1353
1367
  - spec/support/controller_macros.rb
1354
1368
  - spec/support/devise.rb