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.
- 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 ManifestationReserveStatsController do
|
4
4
|
fixtures :all
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
8
|
FactoryGirl.create(:manifestation_reserve_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_reserve_stats as @manifestation_reserve_stats' do
|
15
15
|
get :index
|
16
16
|
assigns(:manifestation_reserve_stats).should eq(ManifestationReserveStat.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_reserve_stats as @manifestation_reserve_stats' do
|
24
24
|
get :index
|
25
25
|
assigns(:manifestation_reserve_stats).should eq(ManifestationReserveStat.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_reserve_stats as @manifestation_reserve_stats' do
|
33
33
|
get :index
|
34
34
|
assigns(:manifestation_reserve_stats).should eq(ManifestationReserveStat.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_reserve_stats as @manifestation_reserve_stats' do
|
40
40
|
get :index
|
41
41
|
assigns(:manifestation_reserve_stats).should eq(ManifestationReserveStat.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_reserve_stat as @manifestation_reserve_stat' do
|
51
51
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
52
|
-
get :show, :
|
52
|
+
get :show, id: manifestation_reserve_stat.id
|
53
53
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
61
61
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
62
|
-
get :show, :
|
62
|
+
get :show, id: manifestation_reserve_stat.id
|
63
63
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
71
71
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
72
|
-
get :show, :
|
72
|
+
get :show, id: manifestation_reserve_stat.id
|
73
73
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
79
79
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
80
|
-
get :show, :
|
80
|
+
get :show, id: manifestation_reserve_stat.id
|
81
81
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
91
91
|
get :new
|
92
92
|
assigns(:manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
100
100
|
get :new
|
101
101
|
assigns(:manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
109
109
|
get :new
|
110
110
|
assigns(:manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
117
117
|
get :new
|
118
118
|
assigns(:manifestation_reserve_stat).should be_nil
|
119
119
|
response.should redirect_to(new_user_session_url)
|
@@ -121,315 +121,315 @@ describe ManifestationReserveStatsController 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_reserve_stat as @manifestation_reserve_stat' do
|
129
129
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
130
|
-
get :edit, :
|
130
|
+
get :edit, id: manifestation_reserve_stat.id
|
131
131
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
139
139
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
140
|
-
get :edit, :
|
140
|
+
get :edit, id: manifestation_reserve_stat.id
|
141
141
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
149
149
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
150
|
-
get :edit, :
|
150
|
+
get :edit, id: manifestation_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
157
157
|
manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
158
|
-
get :edit, :
|
158
|
+
get :edit, id: manifestation_reserve_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_reserve_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_reserve_stat as @manifestation_reserve_stat' do
|
175
|
+
post :create, manifestation_reserve_stat: @attrs
|
176
176
|
assigns(:manifestation_reserve_stat).should be_valid
|
177
177
|
end
|
178
178
|
|
179
|
-
it
|
180
|
-
post :create, :
|
179
|
+
it 'redirects to the created manifestation_reserve_stat' do
|
180
|
+
post :create, manifestation_reserve_stat: @attrs
|
181
181
|
response.should redirect_to(manifestation_reserve_stat_url(assigns(:manifestation_reserve_stat)))
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
|
-
describe
|
186
|
-
it
|
187
|
-
post :create, :
|
185
|
+
describe 'with invalid params' do
|
186
|
+
it 'assigns a newly created but unsaved manifestation_reserve_stat as @manifestation_reserve_stat' do
|
187
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
188
188
|
assigns(:manifestation_reserve_stat).should_not be_valid
|
189
189
|
end
|
190
190
|
|
191
191
|
it "re-renders the 'new' template" do
|
192
|
-
post :create, :
|
193
|
-
response.should render_template(
|
192
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
193
|
+
response.should render_template('new')
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
197
197
|
|
198
|
-
describe
|
198
|
+
describe 'When logged in as Librarian' do
|
199
199
|
login_fixture_librarian
|
200
200
|
|
201
|
-
describe
|
202
|
-
it
|
203
|
-
post :create, :
|
201
|
+
describe 'with valid params' do
|
202
|
+
it 'assigns a newly created manifestation_reserve_stat as @manifestation_reserve_stat' do
|
203
|
+
post :create, manifestation_reserve_stat: @attrs
|
204
204
|
assigns(:manifestation_reserve_stat).should be_valid
|
205
205
|
end
|
206
206
|
|
207
|
-
it
|
208
|
-
post :create, :
|
207
|
+
it 'redirects to the created manifestation_reserve_stat' do
|
208
|
+
post :create, manifestation_reserve_stat: @attrs
|
209
209
|
response.should redirect_to(manifestation_reserve_stat_url(assigns(:manifestation_reserve_stat)))
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
-
describe
|
214
|
-
it
|
215
|
-
post :create, :
|
213
|
+
describe 'with invalid params' do
|
214
|
+
it 'assigns a newly created but unsaved manifestation_reserve_stat as @manifestation_reserve_stat' do
|
215
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
216
216
|
assigns(:manifestation_reserve_stat).should_not be_valid
|
217
217
|
end
|
218
218
|
|
219
219
|
it "re-renders the 'new' template" do
|
220
|
-
post :create, :
|
221
|
-
response.should render_template(
|
220
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
221
|
+
response.should render_template('new')
|
222
222
|
end
|
223
223
|
end
|
224
224
|
end
|
225
225
|
|
226
|
-
describe
|
226
|
+
describe 'When logged in as User' do
|
227
227
|
login_fixture_user
|
228
228
|
|
229
|
-
describe
|
230
|
-
it
|
231
|
-
post :create, :
|
229
|
+
describe 'with valid params' do
|
230
|
+
it 'assigns a newly created manifestation_reserve_stat as @manifestation_reserve_stat' do
|
231
|
+
post :create, manifestation_reserve_stat: @attrs
|
232
232
|
assigns(:manifestation_reserve_stat).should be_nil
|
233
233
|
end
|
234
234
|
|
235
|
-
it
|
236
|
-
post :create, :
|
235
|
+
it 'should be forbidden' do
|
236
|
+
post :create, manifestation_reserve_stat: @attrs
|
237
237
|
response.should be_forbidden
|
238
238
|
end
|
239
239
|
end
|
240
240
|
|
241
|
-
describe
|
242
|
-
it
|
243
|
-
post :create, :
|
241
|
+
describe 'with invalid params' do
|
242
|
+
it 'assigns a newly created but unsaved manifestation_reserve_stat as @manifestation_reserve_stat' do
|
243
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
244
244
|
assigns(:manifestation_reserve_stat).should be_nil
|
245
245
|
end
|
246
246
|
|
247
|
-
it
|
248
|
-
post :create, :
|
247
|
+
it 'should be forbidden' do
|
248
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
249
249
|
response.should be_forbidden
|
250
250
|
end
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
254
|
-
describe
|
255
|
-
describe
|
256
|
-
it
|
257
|
-
post :create, :
|
254
|
+
describe 'When not logged in' do
|
255
|
+
describe 'with valid params' do
|
256
|
+
it 'assigns a newly created manifestation_reserve_stat as @manifestation_reserve_stat' do
|
257
|
+
post :create, manifestation_reserve_stat: @attrs
|
258
258
|
assigns(:manifestation_reserve_stat).should be_nil
|
259
259
|
end
|
260
260
|
|
261
|
-
it
|
262
|
-
post :create, :
|
261
|
+
it 'should be forbidden' do
|
262
|
+
post :create, manifestation_reserve_stat: @attrs
|
263
263
|
response.should redirect_to(new_user_session_url)
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
267
|
-
describe
|
268
|
-
it
|
269
|
-
post :create, :
|
267
|
+
describe 'with invalid params' do
|
268
|
+
it 'assigns a newly created but unsaved manifestation_reserve_stat as @manifestation_reserve_stat' do
|
269
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
270
270
|
assigns(:manifestation_reserve_stat).should be_nil
|
271
271
|
end
|
272
272
|
|
273
|
-
it
|
274
|
-
post :create, :
|
273
|
+
it 'should be forbidden' do
|
274
|
+
post :create, manifestation_reserve_stat: @invalid_attrs
|
275
275
|
response.should redirect_to(new_user_session_url)
|
276
276
|
end
|
277
277
|
end
|
278
278
|
end
|
279
279
|
end
|
280
280
|
|
281
|
-
describe
|
281
|
+
describe 'PUT update' do
|
282
282
|
before(:each) do
|
283
283
|
@manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
284
284
|
@attrs = FactoryGirl.attributes_for(:manifestation_reserve_stat)
|
285
|
-
@invalid_attrs = {:
|
285
|
+
@invalid_attrs = { start_date: '' }
|
286
286
|
end
|
287
287
|
|
288
|
-
describe
|
288
|
+
describe 'When logged in as Administrator' do
|
289
289
|
login_fixture_admin
|
290
290
|
|
291
|
-
describe
|
292
|
-
it
|
293
|
-
put :update, :
|
291
|
+
describe 'with valid params' do
|
292
|
+
it 'updates the requested manifestation_reserve_stat' do
|
293
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
294
294
|
end
|
295
295
|
|
296
|
-
it
|
297
|
-
put :update, :
|
296
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
297
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
298
298
|
assigns(:manifestation_reserve_stat).should eq(@manifestation_reserve_stat)
|
299
299
|
end
|
300
300
|
end
|
301
301
|
|
302
|
-
describe
|
303
|
-
it
|
304
|
-
put :update, :
|
305
|
-
response.should render_template(
|
302
|
+
describe 'with invalid params' do
|
303
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
304
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @invalid_attrs
|
305
|
+
response.should render_template('edit')
|
306
306
|
end
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
|
-
describe
|
310
|
+
describe 'When logged in as Librarian' do
|
311
311
|
login_fixture_librarian
|
312
312
|
|
313
|
-
describe
|
314
|
-
it
|
315
|
-
put :update, :
|
313
|
+
describe 'with valid params' do
|
314
|
+
it 'updates the requested manifestation_reserve_stat' do
|
315
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
316
316
|
end
|
317
317
|
|
318
|
-
it
|
319
|
-
put :update, :
|
318
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
319
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
320
320
|
assigns(:manifestation_reserve_stat).should eq(@manifestation_reserve_stat)
|
321
321
|
response.should redirect_to(@manifestation_reserve_stat)
|
322
322
|
end
|
323
323
|
end
|
324
324
|
|
325
|
-
describe
|
326
|
-
it
|
327
|
-
put :update, :
|
325
|
+
describe 'with invalid params' do
|
326
|
+
it 'assigns the manifestation_reserve_stat as @manifestation_reserve_stat' do
|
327
|
+
put :update, id: @manifestation_reserve_stat, manifestation_reserve_stat: @invalid_attrs
|
328
328
|
assigns(:manifestation_reserve_stat).should_not be_valid
|
329
329
|
end
|
330
330
|
|
331
331
|
it "re-renders the 'edit' template" do
|
332
|
-
put :update, :
|
333
|
-
response.should render_template(
|
332
|
+
put :update, id: @manifestation_reserve_stat, manifestation_reserve_stat: @invalid_attrs
|
333
|
+
response.should render_template('edit')
|
334
334
|
end
|
335
335
|
end
|
336
336
|
end
|
337
337
|
|
338
|
-
describe
|
338
|
+
describe 'When logged in as User' do
|
339
339
|
login_fixture_user
|
340
340
|
|
341
|
-
describe
|
342
|
-
it
|
343
|
-
put :update, :
|
341
|
+
describe 'with valid params' do
|
342
|
+
it 'updates the requested manifestation_reserve_stat' do
|
343
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
344
344
|
end
|
345
345
|
|
346
|
-
it
|
347
|
-
put :update, :
|
346
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
347
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
348
348
|
assigns(:manifestation_reserve_stat).should eq(@manifestation_reserve_stat)
|
349
349
|
response.should be_forbidden
|
350
350
|
end
|
351
351
|
end
|
352
352
|
|
353
|
-
describe
|
354
|
-
it
|
355
|
-
put :update, :
|
353
|
+
describe 'with invalid params' do
|
354
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
355
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @invalid_attrs
|
356
356
|
response.should be_forbidden
|
357
357
|
end
|
358
358
|
end
|
359
359
|
end
|
360
360
|
|
361
|
-
describe
|
362
|
-
describe
|
363
|
-
it
|
364
|
-
put :update, :
|
361
|
+
describe 'When not logged in' do
|
362
|
+
describe 'with valid params' do
|
363
|
+
it 'updates the requested manifestation_reserve_stat' do
|
364
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
365
365
|
end
|
366
366
|
|
367
|
-
it
|
368
|
-
put :update, :
|
367
|
+
it 'should be forbidden' do
|
368
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @attrs
|
369
369
|
response.should redirect_to(new_user_session_url)
|
370
370
|
end
|
371
371
|
end
|
372
372
|
|
373
|
-
describe
|
374
|
-
it
|
375
|
-
put :update, :
|
373
|
+
describe 'with invalid params' do
|
374
|
+
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
375
|
+
put :update, id: @manifestation_reserve_stat.id, manifestation_reserve_stat: @invalid_attrs
|
376
376
|
response.should redirect_to(new_user_session_url)
|
377
377
|
end
|
378
378
|
end
|
379
379
|
end
|
380
380
|
end
|
381
381
|
|
382
|
-
describe
|
382
|
+
describe 'DELETE destroy' do
|
383
383
|
before(:each) do
|
384
384
|
@manifestation_reserve_stat = FactoryGirl.create(:manifestation_reserve_stat)
|
385
385
|
end
|
386
386
|
|
387
|
-
describe
|
387
|
+
describe 'When logged in as Administrator' do
|
388
388
|
login_fixture_admin
|
389
389
|
|
390
|
-
it
|
391
|
-
delete :destroy, :
|
390
|
+
it 'destroys the requested manifestation_reserve_stat' do
|
391
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
392
392
|
end
|
393
393
|
|
394
|
-
it
|
395
|
-
delete :destroy, :
|
394
|
+
it 'redirects to the manifestation_reserve_stats list' do
|
395
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
396
396
|
response.should redirect_to(manifestation_reserve_stats_url)
|
397
397
|
end
|
398
398
|
end
|
399
399
|
|
400
|
-
describe
|
400
|
+
describe 'When logged in as Librarian' do
|
401
401
|
login_fixture_librarian
|
402
402
|
|
403
|
-
it
|
404
|
-
delete :destroy, :
|
403
|
+
it 'destroys the requested manifestation_reserve_stat' do
|
404
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
405
405
|
end
|
406
406
|
|
407
|
-
it
|
408
|
-
delete :destroy, :
|
407
|
+
it 'redirects to the manifestation_reserve_stats list' do
|
408
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
409
409
|
response.should redirect_to(manifestation_reserve_stats_url)
|
410
410
|
end
|
411
411
|
end
|
412
412
|
|
413
|
-
describe
|
413
|
+
describe 'When logged in as User' do
|
414
414
|
login_fixture_user
|
415
415
|
|
416
|
-
it
|
417
|
-
delete :destroy, :
|
416
|
+
it 'destroys the requested manifestation_reserve_stat' do
|
417
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
418
418
|
end
|
419
419
|
|
420
|
-
it
|
421
|
-
delete :destroy, :
|
420
|
+
it 'should be forbidden' do
|
421
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
422
422
|
response.should be_forbidden
|
423
423
|
end
|
424
424
|
end
|
425
425
|
|
426
|
-
describe
|
427
|
-
it
|
428
|
-
delete :destroy, :
|
426
|
+
describe 'When not logged in' do
|
427
|
+
it 'destroys the requested manifestation_reserve_stat' do
|
428
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
429
429
|
end
|
430
430
|
|
431
|
-
it
|
432
|
-
delete :destroy, :
|
431
|
+
it 'should be forbidden' do
|
432
|
+
delete :destroy, id: @manifestation_reserve_stat.id
|
433
433
|
response.should redirect_to(new_user_session_url)
|
434
434
|
end
|
435
435
|
end
|
@@ -3,13 +3,13 @@ require 'rails_helper'
|
|
3
3
|
describe ProfilesController do
|
4
4
|
fixtures :all
|
5
5
|
|
6
|
-
describe
|
7
|
-
describe
|
6
|
+
describe 'GET show' do
|
7
|
+
describe 'When logged in as User' do
|
8
8
|
login_fixture_user
|
9
9
|
|
10
|
-
it
|
10
|
+
it 'should show icalendar feed' do
|
11
11
|
get :edit, id: profiles(:profile_user1).id, mode: 'feed_token'
|
12
|
-
response.should render_template(
|
12
|
+
response.should render_template('profiles/_feed_token')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|