enju_circulation 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/items_helper.rb +1 -1
  3. data/app/models/checked_item.rb +2 -1
  4. data/app/views/carrier_types/_carrier_type_has_checkout_type_fields.html.erb +1 -1
  5. data/lib/enju_circulation/version.rb +1 -1
  6. data/lib/tasks/enju_circulation_tasks.rake +3 -2
  7. data/spec/controllers/carrier_type_has_checkout_types_controller_spec.rb +152 -152
  8. data/spec/controllers/checked_items_controller_spec.rb +135 -135
  9. data/spec/controllers/checkins_controller_spec.rb +161 -161
  10. data/spec/controllers/checkout_types_controller_spec.rb +152 -152
  11. data/spec/controllers/checkouts_controller_spec.rb +103 -103
  12. data/spec/controllers/circulation_statuses_controller_spec.rb +152 -152
  13. data/spec/controllers/item_has_use_restrictions_controller_spec.rb +152 -152
  14. data/spec/controllers/lending_policies_controller_spec.rb +150 -150
  15. data/spec/controllers/manifestation_checkout_stats_controller_spec.rb +152 -152
  16. data/spec/controllers/manifestation_reserve_stats_controller_spec.rb +152 -152
  17. data/spec/controllers/profiles_controller_spec.rb +4 -4
  18. data/spec/controllers/reserves_controller_spec.rb +249 -249
  19. data/spec/controllers/use_restrictions_controller_spec.rb +153 -153
  20. data/spec/controllers/user_checkout_stats_controller_spec.rb +152 -152
  21. data/spec/controllers/user_group_has_checkout_types_controller_spec.rb +150 -150
  22. data/spec/controllers/user_reserve_stats_controller_spec.rb +152 -152
  23. data/spec/dummy/db/schema.rb +12 -2
  24. data/spec/fixtures/checked_items.yml +2 -1
  25. data/spec/helpers/items_helper_spec.rb +0 -1
  26. data/spec/models/checked_item_spec.rb +2 -1
  27. metadata +3 -17
@@ -9,123 +9,123 @@ describe LendingPoliciesController do
9
9
  FactoryGirl.attributes_for(:lending_policy)
10
10
  end
11
11
 
12
- describe "GET index" do
12
+ describe 'GET index' do
13
13
  before(:each) do
14
14
  FactoryGirl.create(:lending_policy)
15
15
  end
16
16
 
17
- describe "When logged in as Administrator" do
17
+ describe 'When logged in as Administrator' do
18
18
  login_fixture_admin
19
19
 
20
- it "assigns all lending_policies as @lending_policies" do
20
+ it 'assigns all lending_policies as @lending_policies' do
21
21
  get :index
22
22
  assigns(:lending_policies).should eq(LendingPolicy.page(1))
23
23
  end
24
24
  end
25
25
 
26
- describe "When logged in as Librarian" do
26
+ describe 'When logged in as Librarian' do
27
27
  login_fixture_librarian
28
28
 
29
- it "assigns all lending_policies as @lending_policies" do
29
+ it 'assigns all lending_policies as @lending_policies' do
30
30
  get :index
31
31
  assigns(:lending_policies).should eq(LendingPolicy.page(1))
32
32
  end
33
33
  end
34
34
 
35
- describe "When logged in as User" do
35
+ describe 'When logged in as User' do
36
36
  login_fixture_user
37
37
 
38
- it "assigns empty as @lending_policies" do
38
+ it 'assigns empty as @lending_policies' do
39
39
  get :index
40
40
  assigns(:lending_policies).should be_nil
41
41
  end
42
42
  end
43
43
 
44
- describe "When not logged in" do
45
- it "assigns empty lending_policies as @lending_policies" do
44
+ describe 'When not logged in' do
45
+ it 'assigns empty lending_policies as @lending_policies' do
46
46
  get :index
47
47
  assigns(:lending_policies).should be_nil
48
48
  end
49
49
  end
50
50
  end
51
51
 
52
- describe "GET show" do
52
+ describe 'GET show' do
53
53
  before(:each) do
54
54
  @lending_policy = FactoryGirl.create(:lending_policy)
55
55
  end
56
56
 
57
- describe "When logged in as Administrator" do
57
+ describe 'When logged in as Administrator' do
58
58
  login_fixture_admin
59
59
 
60
- it "assigns the requested lending_policy as @lending_policy" do
61
- get :show, :id => @lending_policy.id
60
+ it 'assigns the requested lending_policy as @lending_policy' do
61
+ get :show, id: @lending_policy.id
62
62
  assigns(:lending_policy).should eq(@lending_policy)
63
63
  response.should be_success
64
64
  end
65
65
  end
66
66
 
67
- describe "When logged in as Librarian" do
67
+ describe 'When logged in as Librarian' do
68
68
  login_fixture_librarian
69
69
 
70
- it "assigns the requested lending_policy as @lending_policy" do
71
- get :show, :id => @lending_policy.id
70
+ it 'assigns the requested lending_policy as @lending_policy' do
71
+ get :show, id: @lending_policy.id
72
72
  assigns(:lending_policy).should eq(@lending_policy)
73
73
  response.should be_success
74
74
  end
75
75
  end
76
76
 
77
- describe "When logged in as User" do
77
+ describe 'When logged in as User' do
78
78
  login_fixture_user
79
79
 
80
- it "should be forbidden" do
81
- get :show, :id => @lending_policy.id
80
+ it 'should be forbidden' do
81
+ get :show, id: @lending_policy.id
82
82
  assigns(:lending_policy).should eq(@lending_policy)
83
83
  response.should be_forbidden
84
84
  end
85
85
  end
86
86
 
87
- describe "When not logged in" do
88
- it "should be redirected to new_user_session_url" do
89
- get :show, :id => @lending_policy.id
87
+ describe 'When not logged in' do
88
+ it 'should be redirected to new_user_session_url' do
89
+ get :show, id: @lending_policy.id
90
90
  assigns(:lending_policy).should eq(@lending_policy)
91
91
  response.should redirect_to new_user_session_url
92
92
  end
93
93
  end
94
94
  end
95
95
 
96
- describe "GET new" do
97
- describe "When logged in as Administrator" do
96
+ describe 'GET new' do
97
+ describe 'When logged in as Administrator' do
98
98
  login_fixture_admin
99
99
 
100
- it "assigns the requested lending_policy as @lending_policy" do
100
+ it 'assigns the requested lending_policy as @lending_policy' do
101
101
  get :new
102
102
  assigns(:lending_policy).should be_nil
103
103
  response.should be_forbidden
104
104
  end
105
105
  end
106
106
 
107
- describe "When logged in as Librarian" do
107
+ describe 'When logged in as Librarian' do
108
108
  login_fixture_librarian
109
109
 
110
- it "should not assign the requested lending_policy as @lending_policy" do
110
+ it 'should not assign the requested lending_policy as @lending_policy' do
111
111
  get :new
112
112
  assigns(:lending_policy).should be_nil
113
113
  response.should be_forbidden
114
114
  end
115
115
  end
116
116
 
117
- describe "When logged in as User" do
117
+ describe 'When logged in as User' do
118
118
  login_fixture_user
119
119
 
120
- it "should not assign the requested lending_policy as @lending_policy" do
120
+ it 'should not assign the requested lending_policy as @lending_policy' do
121
121
  get :new
122
122
  assigns(:lending_policy).should be_nil
123
123
  response.should be_forbidden
124
124
  end
125
125
  end
126
126
 
127
- describe "When not logged in" do
128
- it "should not assign the requested lending_policy as @lending_policy" do
127
+ describe 'When not logged in' do
128
+ it 'should not assign the requested lending_policy as @lending_policy' do
129
129
  get :new
130
130
  assigns(:lending_policy).should be_nil
131
131
  response.should redirect_to(new_user_session_url)
@@ -133,310 +133,310 @@ describe LendingPoliciesController do
133
133
  end
134
134
  end
135
135
 
136
- describe "GET edit" do
137
- describe "When logged in as Administrator" do
136
+ describe 'GET edit' do
137
+ describe 'When logged in as Administrator' do
138
138
  login_fixture_admin
139
139
 
140
- it "assigns the requested lending_policy as @lending_policy" do
140
+ it 'assigns the requested lending_policy as @lending_policy' do
141
141
  lending_policy = FactoryGirl.create(:lending_policy)
142
- get :edit, :id => lending_policy.id
142
+ get :edit, id: lending_policy.id
143
143
  assigns(:lending_policy).should eq(lending_policy)
144
144
  end
145
145
  end
146
146
 
147
- describe "When logged in as Librarian" do
147
+ describe 'When logged in as Librarian' do
148
148
  login_fixture_librarian
149
149
 
150
- it "assigns the requested lending_policy as @lending_policy" do
150
+ it 'assigns the requested lending_policy as @lending_policy' do
151
151
  lending_policy = FactoryGirl.create(:lending_policy)
152
- get :edit, :id => lending_policy.id
152
+ get :edit, id: lending_policy.id
153
153
  response.should be_forbidden
154
154
  end
155
155
  end
156
156
 
157
- describe "When logged in as User" do
157
+ describe 'When logged in as User' do
158
158
  login_fixture_user
159
159
 
160
- it "assigns the requested lending_policy as @lending_policy" do
160
+ it 'assigns the requested lending_policy as @lending_policy' do
161
161
  lending_policy = FactoryGirl.create(:lending_policy)
162
- get :edit, :id => lending_policy.id
162
+ get :edit, id: lending_policy.id
163
163
  response.should be_forbidden
164
164
  end
165
165
  end
166
166
 
167
- describe "When not logged in" do
168
- it "should not assign the requested lending_policy as @lending_policy" do
167
+ describe 'When not logged in' do
168
+ it 'should not assign the requested lending_policy as @lending_policy' do
169
169
  lending_policy = FactoryGirl.create(:lending_policy)
170
- get :edit, :id => lending_policy.id
170
+ get :edit, id: lending_policy.id
171
171
  response.should redirect_to(new_user_session_url)
172
172
  end
173
173
  end
174
174
  end
175
175
 
176
- describe "POST create" do
176
+ describe 'POST create' do
177
177
  before(:each) do
178
178
  @attrs = valid_attributes
179
- @invalid_attrs = {:item_id => ''}
179
+ @invalid_attrs = { item_id: '' }
180
180
  end
181
181
 
182
- describe "When logged in as Administrator" do
182
+ describe 'When logged in as Administrator' do
183
183
  login_fixture_admin
184
184
 
185
- describe "with valid params" do
186
- it "assigns a newly created lending_policy as @lending_policy" do
187
- post :create, :lending_policy => @attrs
185
+ describe 'with valid params' do
186
+ it 'assigns a newly created lending_policy as @lending_policy' do
187
+ post :create, lending_policy: @attrs
188
188
  assigns(:lending_policy).should be_nil
189
189
  end
190
190
 
191
- it "should be forbidden" do
192
- post :create, :lending_policy => @attrs
191
+ it 'should be forbidden' do
192
+ post :create, lending_policy: @attrs
193
193
  response.should be_forbidden
194
194
  end
195
195
  end
196
196
 
197
- describe "with invalid params" do
198
- it "assigns a newly created but unsaved lending_policy as @lending_policy" do
199
- post :create, :lending_policy => @invalid_attrs
197
+ describe 'with invalid params' do
198
+ it 'assigns a newly created but unsaved lending_policy as @lending_policy' do
199
+ post :create, lending_policy: @invalid_attrs
200
200
  assigns(:lending_policy).should be_nil
201
201
  end
202
202
 
203
- it "should be forbidden" do
204
- post :create, :lending_policy => @invalid_attrs
203
+ it 'should be forbidden' do
204
+ post :create, lending_policy: @invalid_attrs
205
205
  response.should be_forbidden
206
206
  end
207
207
  end
208
208
  end
209
209
 
210
- describe "When logged in as Librarian" do
210
+ describe 'When logged in as Librarian' do
211
211
  login_fixture_librarian
212
212
 
213
- describe "with valid params" do
214
- it "assigns a newly created lending_policy as @lending_policy" do
215
- post :create, :lending_policy => @attrs
213
+ describe 'with valid params' do
214
+ it 'assigns a newly created lending_policy as @lending_policy' do
215
+ post :create, lending_policy: @attrs
216
216
  assigns(:lending_policy).should be_nil
217
217
  end
218
218
 
219
- it "should be forbidden" do
220
- post :create, :lending_policy => @attrs
219
+ it 'should be forbidden' do
220
+ post :create, lending_policy: @attrs
221
221
  response.should be_forbidden
222
222
  end
223
223
  end
224
224
 
225
- describe "with invalid params" do
226
- it "assigns a newly created but unsaved lending_policy as @lending_policy" do
227
- post :create, :lending_policy => @invalid_attrs
225
+ describe 'with invalid params' do
226
+ it 'assigns a newly created but unsaved lending_policy as @lending_policy' do
227
+ post :create, lending_policy: @invalid_attrs
228
228
  assigns(:lending_policy).should be_nil
229
229
  end
230
230
 
231
- it "should be forbidden" do
232
- post :create, :lending_policy => @invalid_attrs
231
+ it 'should be forbidden' do
232
+ post :create, lending_policy: @invalid_attrs
233
233
  response.should be_forbidden
234
234
  end
235
235
  end
236
236
  end
237
237
 
238
- describe "When logged in as User" do
238
+ describe 'When logged in as User' do
239
239
  login_fixture_user
240
240
 
241
- describe "with valid params" do
242
- it "assigns a newly created lending_policy as @lending_policy" do
243
- post :create, :lending_policy => @attrs
241
+ describe 'with valid params' do
242
+ it 'assigns a newly created lending_policy as @lending_policy' do
243
+ post :create, lending_policy: @attrs
244
244
  assigns(:lending_policy).should be_nil
245
245
  end
246
246
 
247
- it "should be forbidden" do
248
- post :create, :lending_policy => @attrs
247
+ it 'should be forbidden' do
248
+ post :create, lending_policy: @attrs
249
249
  response.should be_forbidden
250
250
  end
251
251
  end
252
252
 
253
- describe "with invalid params" do
254
- it "assigns a newly created but unsaved lending_policy as @lending_policy" do
255
- post :create, :lending_policy => @invalid_attrs
253
+ describe 'with invalid params' do
254
+ it 'assigns a newly created but unsaved lending_policy as @lending_policy' do
255
+ post :create, lending_policy: @invalid_attrs
256
256
  assigns(:lending_policy).should be_nil
257
257
  end
258
258
 
259
- it "should be forbidden" do
260
- post :create, :lending_policy => @invalid_attrs
259
+ it 'should be forbidden' do
260
+ post :create, lending_policy: @invalid_attrs
261
261
  response.should be_forbidden
262
262
  end
263
263
  end
264
264
  end
265
265
 
266
- describe "When not logged in" do
267
- describe "with valid params" do
268
- it "assigns a newly created lending_policy as @lending_policy" do
269
- post :create, :lending_policy => @attrs
266
+ describe 'When not logged in' do
267
+ describe 'with valid params' do
268
+ it 'assigns a newly created lending_policy as @lending_policy' do
269
+ post :create, lending_policy: @attrs
270
270
  assigns(:lending_policy).should be_nil
271
271
  end
272
272
 
273
- it "should be forbidden" do
274
- post :create, :lending_policy => @attrs
273
+ it 'should be forbidden' do
274
+ post :create, lending_policy: @attrs
275
275
  response.should redirect_to(new_user_session_url)
276
276
  end
277
277
  end
278
278
 
279
- describe "with invalid params" do
280
- it "assigns a newly created but unsaved lending_policy as @lending_policy" do
281
- post :create, :lending_policy => @invalid_attrs
279
+ describe 'with invalid params' do
280
+ it 'assigns a newly created but unsaved lending_policy as @lending_policy' do
281
+ post :create, lending_policy: @invalid_attrs
282
282
  assigns(:lending_policy).should be_nil
283
283
  end
284
284
 
285
- it "should be forbidden" do
286
- post :create, :lending_policy => @invalid_attrs
285
+ it 'should be forbidden' do
286
+ post :create, lending_policy: @invalid_attrs
287
287
  response.should redirect_to(new_user_session_url)
288
288
  end
289
289
  end
290
290
  end
291
291
  end
292
292
 
293
- describe "PUT update" do
293
+ describe 'PUT update' do
294
294
  before(:each) do
295
295
  @lending_policy = FactoryGirl.create(:lending_policy)
296
296
  @attrs = valid_attributes
297
- @invalid_attrs = {:item_id => ''}
297
+ @invalid_attrs = { item_id: '' }
298
298
  end
299
299
 
300
- describe "When logged in as Administrator" do
300
+ describe 'When logged in as Administrator' do
301
301
  login_fixture_admin
302
302
 
303
- describe "with valid params" do
304
- it "updates the requested lending_policy" do
305
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
303
+ describe 'with valid params' do
304
+ it 'updates the requested lending_policy' do
305
+ put :update, id: @lending_policy.id, lending_policy: @attrs
306
306
  end
307
307
 
308
- it "assigns the requested lending_policy as @lending_policy" do
309
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
308
+ it 'assigns the requested lending_policy as @lending_policy' do
309
+ put :update, id: @lending_policy.id, lending_policy: @attrs
310
310
  assigns(:lending_policy).should eq(@lending_policy)
311
311
  end
312
312
  end
313
313
 
314
- describe "with invalid params" do
315
- it "assigns the requested lending_policy as @lending_policy" do
316
- put :update, :id => @lending_policy.id, :lending_policy => @invalid_attrs
317
- response.should render_template("edit")
314
+ describe 'with invalid params' do
315
+ it 'assigns the requested lending_policy as @lending_policy' do
316
+ put :update, id: @lending_policy.id, lending_policy: @invalid_attrs
317
+ response.should render_template('edit')
318
318
  end
319
319
  end
320
320
  end
321
321
 
322
- describe "When logged in as Librarian" do
322
+ describe 'When logged in as Librarian' do
323
323
  login_fixture_librarian
324
324
 
325
- describe "with valid params" do
326
- it "updates the requested lending_policy" do
327
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
325
+ describe 'with valid params' do
326
+ it 'updates the requested lending_policy' do
327
+ put :update, id: @lending_policy.id, lending_policy: @attrs
328
328
  end
329
329
 
330
- it "assigns the requested lending_policy as @lending_policy" do
331
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
330
+ it 'assigns the requested lending_policy as @lending_policy' do
331
+ put :update, id: @lending_policy.id, lending_policy: @attrs
332
332
  assigns(:lending_policy).should eq(@lending_policy)
333
333
  response.should be_forbidden
334
334
  end
335
335
  end
336
336
 
337
- describe "with invalid params" do
338
- it "assigns the requested lending_policy as @lending_policy" do
339
- put :update, :id => @lending_policy.id, :lending_policy => @invalid_attrs
337
+ describe 'with invalid params' do
338
+ it 'assigns the requested lending_policy as @lending_policy' do
339
+ put :update, id: @lending_policy.id, lending_policy: @invalid_attrs
340
340
  response.should be_forbidden
341
341
  end
342
342
  end
343
343
  end
344
344
 
345
- describe "When logged in as User" do
345
+ describe 'When logged in as User' do
346
346
  login_fixture_user
347
347
 
348
- describe "with valid params" do
349
- it "updates the requested lending_policy" do
350
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
348
+ describe 'with valid params' do
349
+ it 'updates the requested lending_policy' do
350
+ put :update, id: @lending_policy.id, lending_policy: @attrs
351
351
  end
352
352
 
353
- it "assigns the requested lending_policy as @lending_policy" do
354
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
353
+ it 'assigns the requested lending_policy as @lending_policy' do
354
+ put :update, id: @lending_policy.id, lending_policy: @attrs
355
355
  assigns(:lending_policy).should eq(@lending_policy)
356
356
  response.should be_forbidden
357
357
  end
358
358
  end
359
359
 
360
- describe "with invalid params" do
361
- it "assigns the requested lending_policy as @lending_policy" do
362
- put :update, :id => @lending_policy.id, :lending_policy => @invalid_attrs
360
+ describe 'with invalid params' do
361
+ it 'assigns the requested lending_policy as @lending_policy' do
362
+ put :update, id: @lending_policy.id, lending_policy: @invalid_attrs
363
363
  response.should be_forbidden
364
364
  end
365
365
  end
366
366
  end
367
367
 
368
- describe "When not logged in" do
369
- describe "with valid params" do
370
- it "updates the requested lending_policy" do
371
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
368
+ describe 'When not logged in' do
369
+ describe 'with valid params' do
370
+ it 'updates the requested lending_policy' do
371
+ put :update, id: @lending_policy.id, lending_policy: @attrs
372
372
  end
373
373
 
374
- it "should be forbidden" do
375
- put :update, :id => @lending_policy.id, :lending_policy => @attrs
374
+ it 'should be forbidden' do
375
+ put :update, id: @lending_policy.id, lending_policy: @attrs
376
376
  response.should redirect_to(new_user_session_url)
377
377
  end
378
378
  end
379
379
 
380
- describe "with invalid params" do
381
- it "assigns the requested lending_policy as @lending_policy" do
382
- put :update, :id => @lending_policy.id, :lending_policy => @invalid_attrs
380
+ describe 'with invalid params' do
381
+ it 'assigns the requested lending_policy as @lending_policy' do
382
+ put :update, id: @lending_policy.id, lending_policy: @invalid_attrs
383
383
  response.should redirect_to(new_user_session_url)
384
384
  end
385
385
  end
386
386
  end
387
387
  end
388
388
 
389
- describe "DELETE destroy" do
389
+ describe 'DELETE destroy' do
390
390
  before(:each) do
391
391
  @lending_policy = FactoryGirl.create(:lending_policy)
392
392
  end
393
393
 
394
- describe "When logged in as Administrator" do
394
+ describe 'When logged in as Administrator' do
395
395
  login_fixture_admin
396
396
 
397
- it "destroys the requested lending_policy" do
398
- delete :destroy, :id => @lending_policy.id
397
+ it 'destroys the requested lending_policy' do
398
+ delete :destroy, id: @lending_policy.id
399
399
  end
400
400
 
401
- it "redirects to the lending_policies list" do
402
- delete :destroy, :id => @lending_policy.id
401
+ it 'redirects to the lending_policies list' do
402
+ delete :destroy, id: @lending_policy.id
403
403
  response.should redirect_to(lending_policies_url)
404
404
  end
405
405
  end
406
406
 
407
- describe "When logged in as Librarian" do
407
+ describe 'When logged in as Librarian' do
408
408
  login_fixture_librarian
409
409
 
410
- it "destroys the requested lending_policy" do
411
- delete :destroy, :id => @lending_policy.id
410
+ it 'destroys the requested lending_policy' do
411
+ delete :destroy, id: @lending_policy.id
412
412
  end
413
413
 
414
- it "should be forbidden" do
415
- delete :destroy, :id => @lending_policy.id
414
+ it 'should be forbidden' do
415
+ delete :destroy, id: @lending_policy.id
416
416
  response.should be_forbidden
417
417
  end
418
418
  end
419
419
 
420
- describe "When logged in as User" do
420
+ describe 'When logged in as User' do
421
421
  login_fixture_user
422
422
 
423
- it "destroys the requested lending_policy" do
424
- delete :destroy, :id => @lending_policy.id
423
+ it 'destroys the requested lending_policy' do
424
+ delete :destroy, id: @lending_policy.id
425
425
  end
426
426
 
427
- it "should be forbidden" do
428
- delete :destroy, :id => @lending_policy.id
427
+ it 'should be forbidden' do
428
+ delete :destroy, id: @lending_policy.id
429
429
  response.should be_forbidden
430
430
  end
431
431
  end
432
432
 
433
- describe "When not logged in" do
434
- it "destroys the requested lending_policy" do
435
- delete :destroy, :id => @lending_policy.id
433
+ describe 'When not logged in' do
434
+ it 'destroys the requested lending_policy' do
435
+ delete :destroy, id: @lending_policy.id
436
436
  end
437
437
 
438
- it "should be forbidden" do
439
- delete :destroy, :id => @lending_policy.id
438
+ it 'should be forbidden' do
439
+ delete :destroy, id: @lending_policy.id
440
440
  response.should redirect_to(new_user_session_url)
441
441
  end
442
442
  end