enju_library 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f7ca81f27977a33233a2c3d8cf63d4573c4e1a77
4
- data.tar.gz: 92931c38dd723cedc5f09ae4302aa008f73f8d5e
2
+ SHA256:
3
+ metadata.gz: d77bdde03f2503414e4c6cb2392231192de3016ead53bffbf69e35de7d584288
4
+ data.tar.gz: 3a0beeecc968ac5dc5101dae91bcf2673ca601548fd4529c981e2751915aa83e
5
5
  SHA512:
6
- metadata.gz: ef50c8fcd49f6a7e05878c93d9713645e5e7cef8d79efc69790b9e9e80de8993073a76aea456d36d384c1b1de427723f42d5b703a1012f7c2718dcac4697f21d
7
- data.tar.gz: da03bb55a83508a38419fe48471e6d4bb036e1d7341df7d01f6f484c226b658995f2917cb758717a3d402ace3b0a65753739a4d7e489054bb018c1a3b6f62172
6
+ metadata.gz: d03ed3f75d7d7e69d1713988cdd1b4aa3e9074bcca2005d7b5eeef83d0c55079032b1cc4d0685df6cc9d1ed3c80a08c3cdec9769937dfa94cfcaa4297d6b2668
7
+ data.tar.gz: cbfc93babf645402a4c3572ab8e59aa9c9a9ea27de906aebfb74ba4a394dfba3ee730c3547ba84e23d6da45ca8aab5361adad5432548f026fa6bd34bd022e61f
@@ -15,6 +15,7 @@ class Withdraw < ActiveRecord::Base
15
15
 
16
16
  def check_item
17
17
  errors.add(:item) if item.try(:rent?)
18
+ errors.add(:item) if item.try(:reserved?)
18
19
  end
19
20
  end
20
21
 
@@ -26,10 +26,6 @@
26
26
  <%= f.text_field :number_of_time_to_notify_overdue, class: 'resource_integer' %>
27
27
  </div>
28
28
 
29
- <% if defined?(EnjuCirculation) and !@user_group.new_record? %>
30
- <%= render 'user_groups/checkout_form', f: f %>
31
- <% end %>
32
-
33
29
  <div class="field">
34
30
  <%= f.label :note %><br />
35
31
  <%= f.text_area :note %>
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -12,7 +12,7 @@ require "enju_manifestation_viewer"
12
12
  module Dummy
13
13
  class Application < Rails::Application
14
14
  # Initialize configuration defaults for originally generated Rails version.
15
- config.load_defaults 5.1
15
+ config.load_defaults 5.2
16
16
 
17
17
  # Settings in config/environments/* take precedence over those specified here.
18
18
  # Application configuration should go into files in config/initializers
@@ -1,30 +1,25 @@
1
- sqlite: &sqlite
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
2
8
  adapter: sqlite3
3
- database: db/<%= Rails.env %>.sqlite3
4
-
5
- mysql: &mysql
6
- adapter: mysql2
7
- username: root
8
- password:
9
- database: enju_<%= Rails.env %>
10
-
11
- postgresql: &postgresql
12
- adapter: postgresql
13
- username: postgres
14
- password:
15
- database: enju_<%= Rails.env %>
16
-
17
- defaults: &defaults
18
- pool: 5
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
19
10
  timeout: 5000
20
- host: localhost
21
- <<: *<%= ENV['DB'] || "sqlite" %>
22
11
 
23
12
  development:
24
- <<: *defaults
13
+ <<: *default
14
+ database: db/development.sqlite3
25
15
 
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
26
19
  test:
27
- <<: *defaults
20
+ <<: *default
21
+ database: db/test.sqlite3
28
22
 
29
23
  production:
30
- <<: *defaults
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -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: 20180107160740) do
13
+ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
14
14
 
15
15
  create_table "accepts", force: :cascade do |t|
16
16
  t.integer "basket_id"
@@ -3,7 +3,7 @@ FactoryBot.define do
3
3
  sequence(:item_identifier){|n| "item_#{n}"}
4
4
  circulation_status_id{CirculationStatus.find(1).id} if defined?(EnjuCircuation)
5
5
  manifestation_id{FactoryBot.create(:manifestation).id}
6
- bookstore_id 1
7
- budget_type_id 1
6
+ bookstore_id { 1 }
7
+ budget_type_id { 1 }
8
8
  end
9
9
  end
@@ -1,8 +1,8 @@
1
1
  FactoryBot.define do
2
2
  factory :manifestation do
3
3
  sequence(:original_title){|n| "manifestation_title_#{n}"}
4
- carrier_type_id 1
5
- content_type_id 1
6
- frequency_id 1
4
+ carrier_type_id { 1 }
5
+ content_type_id { 1 }
6
+ frequency_id { 1 }
7
7
  end
8
8
  end
@@ -3,8 +3,8 @@ FactoryBot.define do
3
3
  f.user_group_id {UserGroup.first.id}
4
4
  f.required_role_id {Role.where(name: 'User').first.id}
5
5
  f.sequence(:user_number){|n| "user_number_#{n}"}
6
- f.library_id 2
7
- f.locale "ja"
6
+ f.library_id { 2 }
7
+ f.locale { "ja" }
8
8
  f.user_id {FactoryBot.create(:user).id}
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@ FactoryBot.define do
3
3
  f.sequence(:name){|n| "search_engine_#{n}"}
4
4
  f.sequence(:url){|n| "http://search-engine-#{n}.example.jp"}
5
5
  f.sequence(:base_url){|n| "http://search-engine-#{n}.example.jp"}
6
- f.query_param 'q'
7
- f.http_method 'get'
6
+ f.query_param { 'q' }
7
+ f.http_method { 'get' }
8
8
  end
9
9
  end
@@ -2,7 +2,7 @@ FactoryBot.define do
2
2
  factory :subscribe do |f|
3
3
  f.subscription_id{FactoryBot.create(:subscription).id}
4
4
  f.work_id{FactoryBot.create(:manifestation).id}
5
- f.start_at 1.year.ago
6
- f.end_at 1.year.from_now
5
+ f.start_at { 1.year.ago }
6
+ f.end_at { 1.year.from_now }
7
7
  end
8
8
  end
@@ -0,0 +1,46 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe 'Libraries', 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 library config' do
13
+ visit library_path(libraries(:library_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 library config' do
24
+ visit library_path(libraries(:library_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 library config' do
35
+ visit library_path(libraries(:library_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 library config' do
42
+ visit library_path(libraries(:library_00002).id, locale: :ja)
43
+ expect(page).not_to have_content '設定'
44
+ end
45
+ end
46
+ end
data/spec/rails_helper.rb CHANGED
@@ -59,6 +59,12 @@ RSpec.configure do |config|
59
59
  config.infer_spec_type_from_file_location!
60
60
 
61
61
  config.extend ControllerMacros, type: :controller
62
+
63
+ config.before(:each) do |example|
64
+ if example.metadata[:type] == :system
65
+ driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]
66
+ end
67
+ end
62
68
  end
63
69
 
64
70
  FactoryBot.definition_file_paths << "#{::Rails.root}/../../spec/factories"
@@ -0,0 +1,46 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe 'Shelves', 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 shelf config' do
13
+ visit shelf_path(shelves(:shelf_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 shelf config' do
24
+ visit shelf_path(shelves(:shelf_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 shelf config' do
35
+ visit shelf_path(shelves(:shelf_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 shelf config' do
42
+ visit shelf_path(shelves(:shelf_00002).id, locale: :ja)
43
+ expect(page).not_to have_content '新規作成'
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,46 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe 'Libraries', 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 library config' do
13
+ visit library_path(libraries(:library_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 library config' do
24
+ visit library_path(libraries(:library_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 library config' do
35
+ visit library_path(libraries(:library_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 library config' do
42
+ visit library_path(libraries(:library_00002).id, locale: :ja)
43
+ expect(page).not_to have_content '設定'
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,46 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe 'Shelves', 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 shelf config' do
13
+ visit shelf_path(shelves(:shelf_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 shelf config' do
24
+ visit shelf_path(shelves(:shelf_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 shelf config' do
35
+ visit shelf_path(shelves(:shelf_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 shelf config' do
42
+ visit shelf_path(shelves(:shelf_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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2019-04-28 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.3.0
19
+ version: 0.3.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.3.0
26
+ version: 0.3.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: paper_trail
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.4'
61
+ version: '4.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.4'
68
+ version: '4.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: paperclip
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,84 +100,84 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3.0
103
+ version: 1.3.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: 1.3.0
110
+ version: 1.3.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: enju_biblio
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.3.0
117
+ version: 0.3.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.3.0
124
+ version: 0.3.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: enju_manifestation_viewer
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.3.0
131
+ version: 0.3.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.3.0
138
+ version: 0.3.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: enju_ndl
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.0
145
+ version: 0.3.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.3.0
152
+ version: 0.3.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: enju_event
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.0
159
+ version: 0.3.1
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: 0.3.0
166
+ version: 0.3.1
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: enju_circulation
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.3.0
173
+ version: 0.3.1
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.3.0
180
+ version: 0.3.1
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: sqlite3
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -226,28 +226,28 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '3.7'
229
+ version: '3.8'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '3.7'
236
+ version: '3.8'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: factory_bot_rails
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ">="
241
+ - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '0'
243
+ version: '4.11'
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ">="
248
+ - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '0'
250
+ version: '4.11'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: sunspot_solr
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -324,14 +324,42 @@ dependencies:
324
324
  requirements:
325
325
  - - "~>"
326
326
  - !ruby/object:Gem::Version
327
- version: '3.3'
327
+ version: '3.11'
328
328
  type: :development
329
329
  prerelease: false
330
330
  version_requirements: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - "~>"
333
333
  - !ruby/object:Gem::Version
334
- version: '3.3'
334
+ version: '3.11'
335
+ - !ruby/object:Gem::Dependency
336
+ name: selenium-webdriver
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :development
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - ">="
347
+ - !ruby/object:Gem::Version
348
+ version: '0'
349
+ - !ruby/object:Gem::Dependency
350
+ name: puma
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - ">="
354
+ - !ruby/object:Gem::Version
355
+ version: '0'
356
+ type: :development
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - ">="
361
+ - !ruby/object:Gem::Version
362
+ version: '0'
335
363
  description: Library module for Next-L Enju
336
364
  email:
337
365
  - nabeta@fastmail.fm
@@ -926,6 +954,7 @@ files:
926
954
  - spec/fixtures/user_reserve_stats.yml
927
955
  - spec/fixtures/users.yml
928
956
  - spec/fixtures/withdraws.yml
957
+ - spec/libraries_spec.rb
929
958
  - spec/models/accept_spec.rb
930
959
  - spec/models/basket_spec.rb
931
960
  - spec/models/bookstore_spec.rb
@@ -949,9 +978,12 @@ files:
949
978
  - spec/routing/budget_types_routing_spec.rb
950
979
  - spec/routing/libraries_routing_spec.rb
951
980
  - spec/routing/withdraws_routing_spec.rb
981
+ - spec/shelves_spec.rb
952
982
  - spec/spec_helper.rb
953
983
  - spec/support/controller_macros.rb
954
984
  - spec/support/devise.rb
985
+ - spec/system/libraries_spec.rb
986
+ - spec/system/shelves_spec.rb
955
987
  - spec/views/accepts/edit.html.erb_spec.rb
956
988
  - spec/views/accepts/index.html.erb_spec.rb
957
989
  - spec/views/accepts/new.html.erb_spec.rb
@@ -987,8 +1019,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
987
1019
  - !ruby/object:Gem::Version
988
1020
  version: '0'
989
1021
  requirements: []
990
- rubyforge_project:
991
- rubygems_version: 2.6.14.3
1022
+ rubygems_version: 3.0.3
992
1023
  signing_key:
993
1024
  specification_version: 4
994
1025
  summary: enju_library plugin
@@ -1250,6 +1281,7 @@ test_files:
1250
1281
  - spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb
1251
1282
  - spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb
1252
1283
  - spec/dummy/README.rdoc
1284
+ - spec/libraries_spec.rb
1253
1285
  - spec/models/library_group_spec.rb
1254
1286
  - spec/models/request_type_spec.rb
1255
1287
  - spec/models/withdraw_spec.rb
@@ -1267,6 +1299,9 @@ test_files:
1267
1299
  - spec/models/subscribe_spec.rb
1268
1300
  - spec/models/accept_spec.rb
1269
1301
  - spec/models/basket_spec.rb
1302
+ - spec/shelves_spec.rb
1303
+ - spec/system/libraries_spec.rb
1304
+ - spec/system/shelves_spec.rb
1270
1305
  - spec/support/controller_macros.rb
1271
1306
  - spec/support/devise.rb
1272
1307
  - spec/factories/item.rb