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