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
@@ -3,53 +3,53 @@ require 'rails_helper'
3
3
  describe CheckinsController do
4
4
  fixtures :all
5
5
 
6
- def mock_user(stubs={})
6
+ def mock_user(stubs = {})
7
7
  (@mock_user ||= mock_model(Checkin).as_null_object).tap do |user|
8
8
  user.stub(stubs) unless stubs.empty?
9
9
  end
10
10
  end
11
11
 
12
- describe "GET index" do
13
- describe "When logged in as Administrator" do
12
+ describe 'GET index' do
13
+ describe 'When logged in as Administrator' do
14
14
  login_fixture_admin
15
15
 
16
- it "assigns all checkins as @checkins" do
16
+ it 'assigns all checkins as @checkins' do
17
17
  get :index
18
18
  assigns(:checkins).should eq Checkin.page(1)
19
19
  response.should be_success
20
20
  end
21
21
 
22
- describe "When basket_id is specified" do
23
- it "assigns all checkins as @checkins" do
24
- get :index, :basket_id => 10
22
+ describe 'When basket_id is specified' do
23
+ it 'assigns all checkins as @checkins' do
24
+ get :index, basket_id: 10
25
25
  assigns(:checkins).should eq Basket.find(10).checkins.page(1)
26
26
  response.should be_success
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
- describe "When logged in as Librarian" do
31
+ describe 'When logged in as Librarian' do
32
32
  login_fixture_librarian
33
33
 
34
- it "assigns all checkins as @checkins" do
34
+ it 'assigns all checkins as @checkins' do
35
35
  get :index
36
36
  assigns(:checkins).should eq Checkin.page(1)
37
37
  response.should be_success
38
38
  end
39
39
 
40
- describe "When basket_id is specified" do
41
- it "assigns all checkins as @checkins" do
42
- get :index, :basket_id => 9
40
+ describe 'When basket_id is specified' do
41
+ it 'assigns all checkins as @checkins' do
42
+ get :index, basket_id: 9
43
43
  assigns(:checkins).should eq Basket.find(9).checkins.page(1)
44
44
  response.should be_success
45
45
  end
46
46
  end
47
47
  end
48
48
 
49
- describe "When logged in as User" do
49
+ describe 'When logged in as User' do
50
50
  login_fixture_user
51
51
 
52
- it "should not assign all checkins as @checkins" do
52
+ it 'should not assign all checkins as @checkins' do
53
53
  get :index
54
54
  assigns(:checkins).should be_nil
55
55
  response.should be_forbidden
@@ -57,79 +57,79 @@ describe CheckinsController do
57
57
  end
58
58
  end
59
59
 
60
- describe "GET show" do
61
- describe "When logged in as Administrator" do
60
+ describe 'GET show' do
61
+ describe 'When logged in as Administrator' do
62
62
  login_fixture_admin
63
63
 
64
- it "assigns the requested checkin as @checkin" do
64
+ it 'assigns the requested checkin as @checkin' do
65
65
  checkin = checkins(:checkin_00001)
66
- get :show, :id => checkin.id
66
+ get :show, id: checkin.id
67
67
  assigns(:checkin).should eq(checkin)
68
68
  end
69
69
  end
70
70
 
71
- describe "When logged in as Librarian" do
71
+ describe 'When logged in as Librarian' do
72
72
  login_fixture_librarian
73
73
 
74
- it "assigns the requested checkin as @checkin" do
74
+ it 'assigns the requested checkin as @checkin' do
75
75
  checkin = checkins(:checkin_00001)
76
- get :show, :id => checkin.id
76
+ get :show, id: checkin.id
77
77
  assigns(:checkin).should eq(checkin)
78
78
  end
79
79
  end
80
80
 
81
- describe "When logged in as User" do
81
+ describe 'When logged in as User' do
82
82
  login_fixture_user
83
83
 
84
- it "assigns the requested checkin as @checkin" do
84
+ it 'assigns the requested checkin as @checkin' do
85
85
  checkin = checkins(:checkin_00001)
86
- get :show, :id => checkin.id
86
+ get :show, id: checkin.id
87
87
  assigns(:checkin).should eq(checkin)
88
88
  response.should be_forbidden
89
89
  end
90
90
  end
91
91
 
92
- describe "When not logged in" do
93
- it "assigns the requested checkin as @checkin" do
92
+ describe 'When not logged in' do
93
+ it 'assigns the requested checkin as @checkin' do
94
94
  checkin = checkins(:checkin_00001)
95
- get :show, :id => checkin.id
95
+ get :show, id: checkin.id
96
96
  assigns(:checkin).should eq(checkin)
97
97
  response.should redirect_to new_user_session_url
98
98
  end
99
99
  end
100
100
  end
101
101
 
102
- describe "GET new" do
103
- describe "When logged in as Administrator" do
102
+ describe 'GET new' do
103
+ describe 'When logged in as Administrator' do
104
104
  login_fixture_admin
105
105
 
106
- it "assigns the requested checkin as @checkin" do
106
+ it 'assigns the requested checkin as @checkin' do
107
107
  get :new
108
108
  assigns(:checkin).should_not be_valid
109
109
  end
110
110
  end
111
111
 
112
- describe "When logged in as Librarian" do
112
+ describe 'When logged in as Librarian' do
113
113
  login_fixture_librarian
114
114
 
115
- it "assigns the requested checkin as @checkin" do
115
+ it 'assigns the requested checkin as @checkin' do
116
116
  get :new
117
117
  assigns(:checkin).should_not be_valid
118
118
  end
119
119
  end
120
120
 
121
- describe "When logged in as User" do
121
+ describe 'When logged in as User' do
122
122
  login_fixture_user
123
123
 
124
- it "should not assign the requested checkin as @checkin" do
124
+ it 'should not assign the requested checkin as @checkin' do
125
125
  get :new
126
126
  assigns(:checkin).should be_nil
127
127
  response.should be_forbidden
128
128
  end
129
129
  end
130
130
 
131
- describe "When not logged in" do
132
- it "should not assign the requested checkin as @checkin" do
131
+ describe 'When not logged in' do
132
+ it 'should not assign the requested checkin as @checkin' do
133
133
  get :new
134
134
  assigns(:checkin).should be_nil
135
135
  response.should redirect_to(new_user_session_url)
@@ -137,75 +137,75 @@ describe CheckinsController do
137
137
  end
138
138
  end
139
139
 
140
- describe "GET edit" do
141
- describe "When logged in as Administrator" do
140
+ describe 'GET edit' do
141
+ describe 'When logged in as Administrator' do
142
142
  login_fixture_admin
143
143
 
144
- it "assigns the requested checkin as @checkin" do
144
+ it 'assigns the requested checkin as @checkin' do
145
145
  checkin = checkins(:checkin_00001)
146
- get :edit, :id => checkin.id
146
+ get :edit, id: checkin.id
147
147
  assigns(:checkin).should eq(checkin)
148
148
  end
149
149
  end
150
150
 
151
- describe "When logged in as Librarian" do
151
+ describe 'When logged in as Librarian' do
152
152
  login_fixture_librarian
153
153
 
154
- it "assigns the requested checkin as @checkin" do
154
+ it 'assigns the requested checkin as @checkin' do
155
155
  checkin = checkins(:checkin_00001)
156
- get :edit, :id => checkin.id
156
+ get :edit, id: checkin.id
157
157
  assigns(:checkin).should eq(checkin)
158
158
  end
159
159
  end
160
160
 
161
- describe "When logged in as User" do
161
+ describe 'When logged in as User' do
162
162
  login_fixture_user
163
163
 
164
- it "assigns the requested checkin as @checkin" do
164
+ it 'assigns the requested checkin as @checkin' do
165
165
  checkin = checkins(:checkin_00001)
166
- get :edit, :id => checkin.id
166
+ get :edit, id: checkin.id
167
167
  response.should be_forbidden
168
168
  end
169
169
  end
170
170
 
171
- describe "When not logged in" do
172
- it "should not assign the requested checkin as @checkin" do
171
+ describe 'When not logged in' do
172
+ it 'should not assign the requested checkin as @checkin' do
173
173
  checkin = checkins(:checkin_00001)
174
- get :edit, :id => checkin.id
174
+ get :edit, id: checkin.id
175
175
  response.should redirect_to(new_user_session_url)
176
176
  end
177
177
  end
178
178
  end
179
179
 
180
- describe "POST create" do
180
+ describe 'POST create' do
181
181
  before(:each) do
182
- @attrs = {:item_identifier => '00003'}
183
- @invalid_attrs = {:item_identifier => 'invalid'}
182
+ @attrs = { item_identifier: '00003' }
183
+ @invalid_attrs = { item_identifier: 'invalid' }
184
184
  end
185
185
 
186
- describe "When logged in as Administrator" do
186
+ describe 'When logged in as Administrator' do
187
187
  login_fixture_admin
188
188
 
189
- describe "with valid params" do
190
- it "assigns a newly created checkin as @checkin" do
191
- post :create, :checkin => @attrs
189
+ describe 'with valid params' do
190
+ it 'assigns a newly created checkin as @checkin' do
191
+ post :create, checkin: @attrs
192
192
  assigns(:checkin).should be_nil
193
193
  end
194
194
 
195
- it "should not create checkin without basket_id" do
196
- post :create, :checkin => @attrs
195
+ it 'should not create checkin without basket_id' do
196
+ post :create, checkin: @attrs
197
197
  response.should be_forbidden
198
198
  end
199
199
 
200
- describe "When basket_id is specified" do
201
- it "redirects to the created checkin" do
202
- post :create, :checkin => @attrs, :basket_id => 9
200
+ describe 'When basket_id is specified' do
201
+ it 'redirects to the created checkin' do
202
+ post :create, checkin: @attrs, basket_id: 9
203
203
  response.should redirect_to(checkins_url(basket_id: assigns(:checkin).basket_id))
204
204
  assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
205
205
  end
206
206
 
207
- it "should checkin the overdue item" do
208
- post :create, :checkin => {:item_identifier => '00014'}, :basket_id => 9
207
+ it 'should checkin the overdue item' do
208
+ post :create, checkin: { item_identifier: '00014' }, basket_id: 9
209
209
  response.should redirect_to(checkins_url(basket_id: assigns(:checkin).basket_id))
210
210
  assigns(:checkin).checkout.should be_valid
211
211
  assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
@@ -213,49 +213,49 @@ describe CheckinsController do
213
213
  end
214
214
  end
215
215
 
216
- describe "with invalid params" do
217
- it "assigns a newly created but unsaved checkin as @checkin" do
218
- post :create, :checkin => @invalid_attrs
216
+ describe 'with invalid params' do
217
+ it 'assigns a newly created but unsaved checkin as @checkin' do
218
+ post :create, checkin: @invalid_attrs
219
219
  assigns(:checkin).should be_nil
220
220
  end
221
221
 
222
- it "should be forbidden" do
223
- post :create, :checkin => @invalid_attrs
222
+ it 'should be forbidden' do
223
+ post :create, checkin: @invalid_attrs
224
224
  response.should be_forbidden
225
225
  end
226
226
  end
227
227
 
228
- it "should not create checkin without item_id" do
229
- post :create, :checkin => {:item_identifier => nil}, :basket_id => 9
228
+ it 'should not create checkin without item_id' do
229
+ post :create, checkin: { item_identifier: nil }, basket_id: 9
230
230
  assigns(:checkin).should_not be_valid
231
231
  response.should be_success
232
232
  end
233
233
  end
234
234
 
235
- describe "When logged in as Librarian" do
235
+ describe 'When logged in as Librarian' do
236
236
  login_fixture_librarian
237
237
 
238
- describe "with valid params" do
239
- it "assigns a newly created checkin as @checkin" do
240
- post :create, :checkin => @attrs
238
+ describe 'with valid params' do
239
+ it 'assigns a newly created checkin as @checkin' do
240
+ post :create, checkin: @attrs
241
241
  assigns(:checkin).should be_nil
242
242
  end
243
243
 
244
- it "should not create checkin without basket_id" do
245
- post :create, :checkin => @attrs
244
+ it 'should not create checkin without basket_id' do
245
+ post :create, checkin: @attrs
246
246
  response.should be_forbidden
247
247
  end
248
248
 
249
- it "should show notification when it is reserved" do
250
- post :create, :checkin => {:item_identifier => '00008'}, :basket_id => 9
249
+ it 'should show notification when it is reserved' do
250
+ post :create, checkin: { item_identifier: '00008' }, basket_id: 9
251
251
  flash[:message].to_s.index(I18n.t('item.this_item_is_reserved')).should be_truthy
252
252
  assigns(:checkin).item.should be_retained
253
253
  assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
254
254
  response.should redirect_to(checkins_url(basket_id: assigns(:basket).id))
255
255
  end
256
256
 
257
- it "should show notification when an item includes supplements" do
258
- post :create, :checkin => {:item_identifier => '00004'}, :basket_id => 9
257
+ it 'should show notification when an item includes supplements' do
258
+ post :create, checkin: { item_identifier: '00004' }, basket_id: 9
259
259
  assigns(:checkin).item.circulation_status.name.should eq 'Available On Shelf'
260
260
  flash[:message].to_s.index(I18n.t('item.this_item_include_supplement')).should be_truthy
261
261
  response.should redirect_to(checkins_url(basket_id: assigns(:basket).id))
@@ -264,211 +264,211 @@ describe CheckinsController do
264
264
 
265
265
  it "should show notice when other library's item is checked in" do
266
266
  sign_in users(:librarian2)
267
- post :create, :checkin => {:item_identifier => '00009'}, :basket_id => 9
267
+ post :create, checkin: { item_identifier: '00009' }, basket_id: 9
268
268
  assigns(:checkin).should be_valid
269
269
  flash[:message].to_s.index(I18n.t('checkin.other_library_item')).should be_truthy
270
270
  response.should redirect_to(checkins_url(basket_id: assigns(:basket).id))
271
271
  end
272
272
  end
273
273
 
274
- describe "When logged in as User" do
274
+ describe 'When logged in as User' do
275
275
  login_fixture_user
276
276
 
277
- describe "with valid params" do
278
- it "assigns a newly created checkin as @checkin" do
279
- post :create, :checkin => @attrs
277
+ describe 'with valid params' do
278
+ it 'assigns a newly created checkin as @checkin' do
279
+ post :create, checkin: @attrs
280
280
  assigns(:checkin).should be_nil
281
281
  end
282
282
 
283
- it "should be forbidden" do
284
- post :create, :checkin => @attrs
283
+ it 'should be forbidden' do
284
+ post :create, checkin: @attrs
285
285
  response.should be_forbidden
286
286
  end
287
287
  end
288
288
  end
289
289
 
290
- describe "When not logged in" do
290
+ describe 'When not logged in' do
291
291
  before(:each) do
292
- @attrs = {:item_identifier => '00003'}
293
- @invalid_attrs = {:item_identifier => 'invalid'}
292
+ @attrs = { item_identifier: '00003' }
293
+ @invalid_attrs = { item_identifier: 'invalid' }
294
294
  end
295
295
 
296
- describe "with valid params" do
297
- it "assigns a newly created checkin as @checkin" do
298
- post :create, :checkin => @attrs
296
+ describe 'with valid params' do
297
+ it 'assigns a newly created checkin as @checkin' do
298
+ post :create, checkin: @attrs
299
299
  end
300
300
 
301
- it "should redirect to new session url" do
302
- post :create, :checkin => @attrs
301
+ it 'should redirect to new session url' do
302
+ post :create, checkin: @attrs
303
303
  response.should redirect_to new_user_session_url
304
304
  end
305
305
  end
306
306
  end
307
307
  end
308
308
 
309
- describe "PUT update" do
309
+ describe 'PUT update' do
310
310
  before(:each) do
311
311
  @checkin = checkins(:checkin_00001)
312
- @attrs = {:item_identifier => @checkin.item.item_identifier}
313
- @invalid_attrs = {:item_identifier => 'invalid'}
312
+ @attrs = { item_identifier: @checkin.item.item_identifier }
313
+ @invalid_attrs = { item_identifier: 'invalid' }
314
314
  end
315
315
 
316
- describe "When logged in as Administrator" do
316
+ describe 'When logged in as Administrator' do
317
317
  login_fixture_admin
318
318
 
319
- describe "with valid params" do
320
- it "updates the requested checkin" do
321
- put :update, :id => @checkin.id, :checkin => @attrs
319
+ describe 'with valid params' do
320
+ it 'updates the requested checkin' do
321
+ put :update, id: @checkin.id, checkin: @attrs
322
322
  end
323
323
 
324
- it "assigns the requested checkin as @checkin" do
325
- put :update, :id => @checkin.id, :checkin => @attrs
324
+ it 'assigns the requested checkin as @checkin' do
325
+ put :update, id: @checkin.id, checkin: @attrs
326
326
  assigns(:checkin).should eq(@checkin)
327
327
  response.should redirect_to(@checkin)
328
328
  end
329
329
  end
330
330
 
331
- describe "with invalid params" do
332
- it "assigns the requested checkin as @checkin" do
333
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
331
+ describe 'with invalid params' do
332
+ it 'assigns the requested checkin as @checkin' do
333
+ put :update, id: @checkin.id, checkin: @invalid_attrs
334
334
  end
335
335
 
336
336
  it "re-renders the 'edit' template" do
337
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
338
- response.should render_template("edit")
337
+ put :update, id: @checkin.id, checkin: @invalid_attrs
338
+ response.should render_template('edit')
339
339
  end
340
340
 
341
- it "should not update checkin without item_identifier" do
342
- put :update, :id => @checkin.id, :checkin => @attrs.merge(:item_identifier => nil)
341
+ it 'should not update checkin without item_identifier' do
342
+ put :update, id: @checkin.id, checkin: @attrs.merge(item_identifier: nil)
343
343
  assigns(:checkin).should be_valid
344
344
  response.should redirect_to(@checkin)
345
345
  end
346
346
  end
347
347
  end
348
348
 
349
- describe "When logged in as Librarian" do
349
+ describe 'When logged in as Librarian' do
350
350
  login_fixture_librarian
351
351
 
352
- describe "with valid params" do
353
- it "updates the requested checkin" do
354
- put :update, :id => @checkin.id, :checkin => @attrs
352
+ describe 'with valid params' do
353
+ it 'updates the requested checkin' do
354
+ put :update, id: @checkin.id, checkin: @attrs
355
355
  end
356
356
 
357
- it "assigns the requested checkin as @checkin" do
358
- put :update, :id => @checkin.id, :checkin => @attrs
357
+ it 'assigns the requested checkin as @checkin' do
358
+ put :update, id: @checkin.id, checkin: @attrs
359
359
  assigns(:checkin).should eq(@checkin)
360
360
  response.should redirect_to(@checkin)
361
361
  end
362
362
  end
363
363
 
364
- describe "with invalid params" do
365
- it "assigns the checkin as @checkin" do
366
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
364
+ describe 'with invalid params' do
365
+ it 'assigns the checkin as @checkin' do
366
+ put :update, id: @checkin.id, checkin: @invalid_attrs
367
367
  assigns(:checkin).should_not be_valid
368
368
  end
369
369
 
370
370
  it "re-renders the 'edit' template" do
371
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
372
- response.should render_template("edit")
371
+ put :update, id: @checkin.id, checkin: @invalid_attrs
372
+ response.should render_template('edit')
373
373
  end
374
374
  end
375
375
  end
376
376
 
377
- describe "When logged in as User" do
377
+ describe 'When logged in as User' do
378
378
  login_fixture_user
379
379
 
380
- describe "with valid params" do
381
- it "updates the requested checkin" do
382
- put :update, :id => @checkin.id, :checkin => @attrs
380
+ describe 'with valid params' do
381
+ it 'updates the requested checkin' do
382
+ put :update, id: @checkin.id, checkin: @attrs
383
383
  end
384
384
 
385
- it "assigns the requested checkin as @checkin" do
386
- put :update, :id => @checkin.id, :checkin => @attrs
385
+ it 'assigns the requested checkin as @checkin' do
386
+ put :update, id: @checkin.id, checkin: @attrs
387
387
  assigns(:checkin).should eq(@checkin)
388
388
  response.should be_forbidden
389
389
  end
390
390
  end
391
391
 
392
- describe "with invalid params" do
393
- it "assigns the requested checkin as @checkin" do
394
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
392
+ describe 'with invalid params' do
393
+ it 'assigns the requested checkin as @checkin' do
394
+ put :update, id: @checkin.id, checkin: @invalid_attrs
395
395
  response.should be_forbidden
396
396
  end
397
397
  end
398
398
  end
399
399
 
400
- describe "When not logged in" do
401
- describe "with valid params" do
402
- it "updates the requested checkin" do
403
- put :update, :id => @checkin.id, :checkin => @attrs
400
+ describe 'When not logged in' do
401
+ describe 'with valid params' do
402
+ it 'updates the requested checkin' do
403
+ put :update, id: @checkin.id, checkin: @attrs
404
404
  end
405
405
 
406
- it "should be forbidden" do
407
- put :update, :id => @checkin.id, :checkin => @attrs
406
+ it 'should be forbidden' do
407
+ put :update, id: @checkin.id, checkin: @attrs
408
408
  response.should redirect_to(new_user_session_url)
409
409
  end
410
410
  end
411
411
 
412
- describe "with invalid params" do
413
- it "assigns the requested checkin as @checkin" do
414
- put :update, :id => @checkin.id, :checkin => @invalid_attrs
412
+ describe 'with invalid params' do
413
+ it 'assigns the requested checkin as @checkin' do
414
+ put :update, id: @checkin.id, checkin: @invalid_attrs
415
415
  response.should redirect_to(new_user_session_url)
416
416
  end
417
417
  end
418
418
  end
419
419
  end
420
420
 
421
- describe "DELETE destroy" do
421
+ describe 'DELETE destroy' do
422
422
  before(:each) do
423
423
  @checkin = checkins(:checkin_00001)
424
424
  end
425
425
 
426
- describe "When logged in as Administrator" do
426
+ describe 'When logged in as Administrator' do
427
427
  login_fixture_admin
428
428
 
429
- it "destroys the requested checkin" do
430
- delete :destroy, :id => @checkin.id
429
+ it 'destroys the requested checkin' do
430
+ delete :destroy, id: @checkin.id
431
431
  end
432
432
 
433
- it "redirects to the checkins list" do
434
- delete :destroy, :id => @checkin.id
433
+ it 'redirects to the checkins list' do
434
+ delete :destroy, id: @checkin.id
435
435
  response.should redirect_to(checkins_url)
436
436
  end
437
437
  end
438
438
 
439
- describe "When logged in as Librarian" do
439
+ describe 'When logged in as Librarian' do
440
440
  login_fixture_librarian
441
441
 
442
- it "destroys the requested checkin" do
443
- delete :destroy, :id => @checkin.id
442
+ it 'destroys the requested checkin' do
443
+ delete :destroy, id: @checkin.id
444
444
  end
445
445
 
446
- it "redirects to the checkins list" do
447
- delete :destroy, :id => @checkin.id
446
+ it 'redirects to the checkins list' do
447
+ delete :destroy, id: @checkin.id
448
448
  response.should redirect_to(checkins_url)
449
449
  end
450
450
  end
451
451
 
452
- describe "When logged in as User" do
452
+ describe 'When logged in as User' do
453
453
  login_fixture_user
454
454
 
455
- it "destroys the requested checkin" do
456
- delete :destroy, :id => @checkin.id
455
+ it 'destroys the requested checkin' do
456
+ delete :destroy, id: @checkin.id
457
457
  end
458
458
 
459
- it "should be forbidden" do
460
- delete :destroy, :id => @checkin.id
459
+ it 'should be forbidden' do
460
+ delete :destroy, id: @checkin.id
461
461
  response.should be_forbidden
462
462
  end
463
463
  end
464
464
 
465
- describe "When not logged in" do
466
- it "destroys the requested checkin" do
467
- delete :destroy, :id => @checkin.id
465
+ describe 'When not logged in' do
466
+ it 'destroys the requested checkin' do
467
+ delete :destroy, id: @checkin.id
468
468
  end
469
469
 
470
- it "should be forbidden" do
471
- delete :destroy, :id => @checkin.id
470
+ it 'should be forbidden' do
471
+ delete :destroy, id: @checkin.id
472
472
  response.should redirect_to(new_user_session_url)
473
473
  end
474
474
  end