enju_circulation 0.3.2 → 0.3.3

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
2
  SHA256:
3
- metadata.gz: 6b71a1452b3731a885beeb265f9f5d3db20604cb7f4397cdddd9269b4e235a7c
4
- data.tar.gz: 79273b205450724cc144ac839d09d82069755f5f84fc78f37948ce396ea292a2
3
+ metadata.gz: b38f62123745a87848e27bea905ec42fc17e30df0fc0ba9853cf7fe98db6d79b
4
+ data.tar.gz: f951bd48af2901ffca4a3a1499f0bbe88595498ceeecdd185909aa0580cdffd6
5
5
  SHA512:
6
- metadata.gz: 4df0bfd6a17b48bdbdf08177ee991c0f8dcebbe1d6e7237e9f41b7eb39e65b32e7d38c9c0b08bfa41add718bc8f5ec26e29dc364003ef4ef9518d8ca8864f246
7
- data.tar.gz: f5e812a6fa13aebc8b642d44d78cbb7a303ca761df3afeef33650fdd9820dc3c9cec390b7a551135088d7fa027244d23b4010b1bf70f83f4c4092e3c3e2c9e0c
6
+ metadata.gz: c0d8649b6101178444596fde67c8574651881d8794bbd0656461fcef65a0fdce66bb67354089842be21412c673c2b1cf98a9ec0d39607ef811f6be8836d23b4e
7
+ data.tar.gz: f6345684a0fc171f5c78b1d41ff764a47fd4b02e97825c16afa5118eccc7e7498ff6b3b0822374203f60557e6c2c5a2315e77b33f6c5806429f736e0462dd1b7
@@ -24,7 +24,7 @@ class CheckoutPolicy < ApplicationPolicy
24
24
  end
25
25
 
26
26
  def destroy?
27
- if record.checkin
27
+ if record.checkin && record.user
28
28
  if user.try(:has_role?, 'Librarian')
29
29
  true
30
30
  elsif user && (user == record.user)
@@ -1,3 +1,3 @@
1
1
  module EnjuCirculation
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -453,6 +453,12 @@ describe CheckoutsController do
453
453
  delete :destroy, params: { id: @returned_checkout.id }
454
454
  response.should redirect_to(checkouts_url(user_id: @returned_checkout.user.username))
455
455
  end
456
+
457
+ it 'should be forbidden to delete a checkout if its user is not set' do
458
+ delete :destroy, params: { id: @returned_checkout.id }
459
+ delete :destroy, params: { id: @returned_checkout.id }
460
+ expect(response).to be_forbidden
461
+ end
456
462
  end
457
463
 
458
464
  describe 'When logged in as Librarian' do
@@ -1,26 +1,26 @@
1
1
  ---
2
2
  circulation_status_00001:
3
- name: Available For Pickup
3
+ name: Available For Pickup
4
4
  display_name: "en: Available For Pickup\r\n\
5
5
  ja: 持ち出し可能"
6
6
  id: 1
7
7
  note: ""
8
8
  position: 1
9
9
  circulation_status_00002:
10
- name: Available On Shelf
10
+ name: Available On Shelf
11
11
  display_name: "en: Available on Shelf\r\n\
12
12
  ja: 在架(利用可能)"
13
13
  id: 2
14
14
  note: ""
15
15
  position: 2
16
16
  circulation_status_00003:
17
- name: Circulation Status Undefined
17
+ name: Circulation Status Undefined
18
18
  display_name: Circulation Status Undefined
19
19
  id: 3
20
20
  note: ""
21
21
  position: 3
22
22
  circulation_status_00004:
23
- name: Claimed Returned Or Never Borrowed
23
+ name: Claimed Returned Or Never Borrowed
24
24
  display_name: Claimed Returned Or Never Borrowed
25
25
  id: 4
26
26
  note: ""
@@ -60,7 +60,7 @@ circulation_status_00009:
60
60
  note: ""
61
61
  position: 9
62
62
  circulation_status_00010:
63
- name: On Loan
63
+ name: On Loan
64
64
  display_name: "en: On Loan\r\n\
65
65
  ja: 貸出中"
66
66
  id: 10
@@ -79,13 +79,13 @@ circulation_status_00012:
79
79
  note: ""
80
80
  position: 12
81
81
  circulation_status_00013:
82
- name: Recalled
82
+ name: Recalled
83
83
  display_name: Recalled
84
84
  id: 13
85
85
  note: ""
86
86
  position: 13
87
87
  circulation_status_00014:
88
- name: Waiting To Be Reshelved
88
+ name: Waiting To Be Reshelved
89
89
  display_name: Waiting To Be Reshelved
90
90
  id: 14
91
91
  note: ""
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_circulation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
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-04-28 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_biblio