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,37 +3,37 @@ require 'rails_helper'
|
|
3
3
|
describe UserGroupHasCheckoutTypesController do
|
4
4
|
fixtures :all
|
5
5
|
|
6
|
-
describe
|
7
|
-
describe
|
6
|
+
describe 'GET index' do
|
7
|
+
describe 'When logged in as Administrator' do
|
8
8
|
login_fixture_admin
|
9
9
|
|
10
|
-
it
|
10
|
+
it 'assigns all user_group_has_checkout_types as @user_group_has_checkout_types' do
|
11
11
|
get :index
|
12
12
|
assigns(:user_group_has_checkout_types).should eq(UserGroupHasCheckoutType.includes([:user_group, :checkout_type]).order('user_groups.position, checkout_types.position').page(1))
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
describe
|
16
|
+
describe 'When logged in as Librarian' do
|
17
17
|
login_fixture_librarian
|
18
18
|
|
19
|
-
it
|
19
|
+
it 'assigns all user_group_has_checkout_types as @user_group_has_checkout_types' do
|
20
20
|
get :index
|
21
21
|
assigns(:user_group_has_checkout_types).should eq(UserGroupHasCheckoutType.includes([:user_group, :checkout_type]).order('user_groups.position, checkout_types.position').page(1))
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
describe
|
25
|
+
describe 'When logged in as User' do
|
26
26
|
login_fixture_user
|
27
27
|
|
28
|
-
it
|
28
|
+
it 'assigns all user_group_has_checkout_types as @user_group_has_checkout_types' do
|
29
29
|
get :index
|
30
30
|
assigns(:user_group_has_checkout_types).should be_nil
|
31
31
|
response.should be_forbidden
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe
|
36
|
-
it
|
35
|
+
describe 'When not logged in' do
|
36
|
+
it 'assigns all user_group_has_checkout_types as @user_group_has_checkout_types' do
|
37
37
|
get :index
|
38
38
|
assigns(:user_group_has_checkout_types).should be_nil
|
39
39
|
response.should redirect_to(new_user_session_url)
|
@@ -41,79 +41,79 @@ describe UserGroupHasCheckoutTypesController do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe
|
45
|
-
describe
|
44
|
+
describe 'GET show' do
|
45
|
+
describe 'When logged in as Administrator' do
|
46
46
|
login_fixture_admin
|
47
47
|
|
48
|
-
it
|
48
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
49
49
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
50
|
-
get :show, :
|
50
|
+
get :show, id: user_group_has_checkout_type.id
|
51
51
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
describe
|
55
|
+
describe 'When logged in as Librarian' do
|
56
56
|
login_fixture_librarian
|
57
57
|
|
58
|
-
it
|
58
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
59
59
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
60
|
-
get :show, :
|
60
|
+
get :show, id: user_group_has_checkout_type.id
|
61
61
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
describe
|
65
|
+
describe 'When logged in as User' do
|
66
66
|
login_fixture_user
|
67
67
|
|
68
|
-
it
|
68
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
69
69
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
70
|
-
get :show, :
|
70
|
+
get :show, id: user_group_has_checkout_type.id
|
71
71
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
describe
|
76
|
-
it
|
75
|
+
describe 'When not logged in' do
|
76
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
77
77
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
78
|
-
get :show, :
|
78
|
+
get :show, id: user_group_has_checkout_type.id
|
79
79
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
describe
|
85
|
-
describe
|
84
|
+
describe 'GET new' do
|
85
|
+
describe 'When logged in as Administrator' do
|
86
86
|
login_fixture_admin
|
87
87
|
|
88
|
-
it
|
88
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
89
89
|
get :new
|
90
90
|
assigns(:user_group_has_checkout_type).should_not be_valid
|
91
91
|
response.should be_success
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
-
describe
|
95
|
+
describe 'When logged in as Librarian' do
|
96
96
|
login_fixture_librarian
|
97
97
|
|
98
|
-
it
|
98
|
+
it 'should not assign the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
99
99
|
get :new
|
100
100
|
assigns(:user_group_has_checkout_type).should be_nil
|
101
101
|
response.should be_forbidden
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
109
109
|
get :new
|
110
110
|
assigns(:user_group_has_checkout_type).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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
117
117
|
get :new
|
118
118
|
assigns(:user_group_has_checkout_type).should be_nil
|
119
119
|
response.should redirect_to(new_user_session_url)
|
@@ -121,310 +121,310 @@ describe UserGroupHasCheckoutTypesController 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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
129
129
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
130
|
-
get :edit, :
|
130
|
+
get :edit, id: user_group_has_checkout_type.id
|
131
131
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
139
139
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
140
|
-
get :edit, :
|
140
|
+
get :edit, id: user_group_has_checkout_type.id
|
141
141
|
response.should be_forbidden
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
149
149
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
150
|
-
get :edit, :
|
150
|
+
get :edit, id: user_group_has_checkout_type.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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
157
157
|
user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
158
|
-
get :edit, :
|
158
|
+
get :edit, id: user_group_has_checkout_type.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(:user_group_has_checkout_type)
|
167
|
-
@invalid_attrs = {:
|
167
|
+
@invalid_attrs = { user_group_id: '' }
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
175
|
+
post :create, user_group_has_checkout_type: @attrs
|
176
176
|
assigns(:user_group_has_checkout_type).should be_valid
|
177
177
|
end
|
178
178
|
|
179
|
-
it
|
180
|
-
post :create, :
|
179
|
+
it 'redirects to the created patron' do
|
180
|
+
post :create, user_group_has_checkout_type: @attrs
|
181
181
|
response.should redirect_to(assigns(:user_group_has_checkout_type))
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
187
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
188
188
|
assigns(:user_group_has_checkout_type).should_not be_valid
|
189
189
|
end
|
190
190
|
|
191
|
-
it
|
192
|
-
post :create, :
|
191
|
+
it 'should be successful' do
|
192
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
193
193
|
response.should be_success
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
203
|
+
post :create, user_group_has_checkout_type: @attrs
|
204
204
|
assigns(:user_group_has_checkout_type).should be_nil
|
205
205
|
end
|
206
206
|
|
207
|
-
it
|
208
|
-
post :create, :
|
207
|
+
it 'should be forbidden' do
|
208
|
+
post :create, user_group_has_checkout_type: @attrs
|
209
209
|
response.should be_forbidden
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
215
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
216
216
|
assigns(:user_group_has_checkout_type).should be_nil
|
217
217
|
end
|
218
218
|
|
219
|
-
it
|
220
|
-
post :create, :
|
219
|
+
it 'should be forbidden' do
|
220
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
221
221
|
response.should be_forbidden
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
231
|
+
post :create, user_group_has_checkout_type: @attrs
|
232
232
|
assigns(:user_group_has_checkout_type).should be_nil
|
233
233
|
end
|
234
234
|
|
235
|
-
it
|
236
|
-
post :create, :
|
235
|
+
it 'should be forbidden' do
|
236
|
+
post :create, user_group_has_checkout_type: @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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
243
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
244
244
|
assigns(:user_group_has_checkout_type).should be_nil
|
245
245
|
end
|
246
246
|
|
247
|
-
it
|
248
|
-
post :create, :
|
247
|
+
it 'should be forbidden' do
|
248
|
+
post :create, user_group_has_checkout_type: @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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
257
|
+
post :create, user_group_has_checkout_type: @attrs
|
258
258
|
assigns(:user_group_has_checkout_type).should be_nil
|
259
259
|
end
|
260
260
|
|
261
|
-
it
|
262
|
-
post :create, :
|
261
|
+
it 'should be forbidden' do
|
262
|
+
post :create, user_group_has_checkout_type: @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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
269
|
+
post :create, user_group_has_checkout_type: @invalid_attrs
|
270
270
|
assigns(:user_group_has_checkout_type).should be_nil
|
271
271
|
end
|
272
272
|
|
273
|
-
it
|
274
|
-
post :create, :
|
273
|
+
it 'should be forbidden' do
|
274
|
+
post :create, user_group_has_checkout_type: @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
|
@user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
284
284
|
@attrs = FactoryGirl.attributes_for(:user_group_has_checkout_type)
|
285
|
-
@invalid_attrs = {:
|
285
|
+
@invalid_attrs = { user_group_id: '' }
|
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 user_group_has_checkout_type' do
|
293
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
294
294
|
end
|
295
295
|
|
296
|
-
it
|
297
|
-
put :update, :
|
296
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
297
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
298
298
|
assigns(:user_group_has_checkout_type).should eq(@user_group_has_checkout_type)
|
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 user_group_has_checkout_type as @user_group_has_checkout_type' do
|
304
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @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 user_group_has_checkout_type' do
|
315
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
316
316
|
end
|
317
317
|
|
318
|
-
it
|
319
|
-
put :update, :
|
318
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
319
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
320
320
|
assigns(:user_group_has_checkout_type).should eq(@user_group_has_checkout_type)
|
321
321
|
response.should be_forbidden
|
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 requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
327
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @invalid_attrs
|
328
328
|
response.should be_forbidden
|
329
329
|
end
|
330
330
|
end
|
331
331
|
end
|
332
332
|
|
333
|
-
describe
|
333
|
+
describe 'When logged in as User' do
|
334
334
|
login_fixture_user
|
335
335
|
|
336
|
-
describe
|
337
|
-
it
|
338
|
-
put :update, :
|
336
|
+
describe 'with valid params' do
|
337
|
+
it 'updates the requested user_group_has_checkout_type' do
|
338
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
339
339
|
end
|
340
340
|
|
341
|
-
it
|
342
|
-
put :update, :
|
341
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
342
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
343
343
|
assigns(:user_group_has_checkout_type).should eq(@user_group_has_checkout_type)
|
344
344
|
response.should be_forbidden
|
345
345
|
end
|
346
346
|
end
|
347
347
|
|
348
|
-
describe
|
349
|
-
it
|
350
|
-
put :update, :
|
348
|
+
describe 'with invalid params' do
|
349
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
350
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @invalid_attrs
|
351
351
|
response.should be_forbidden
|
352
352
|
end
|
353
353
|
end
|
354
354
|
end
|
355
355
|
|
356
|
-
describe
|
357
|
-
describe
|
358
|
-
it
|
359
|
-
put :update, :
|
356
|
+
describe 'When not logged in' do
|
357
|
+
describe 'with valid params' do
|
358
|
+
it 'updates the requested user_group_has_checkout_type' do
|
359
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
360
360
|
end
|
361
361
|
|
362
|
-
it
|
363
|
-
put :update, :
|
362
|
+
it 'should be forbidden' do
|
363
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @attrs
|
364
364
|
response.should redirect_to(new_user_session_url)
|
365
365
|
end
|
366
366
|
end
|
367
367
|
|
368
|
-
describe
|
369
|
-
it
|
370
|
-
put :update, :
|
368
|
+
describe 'with invalid params' do
|
369
|
+
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
370
|
+
put :update, id: @user_group_has_checkout_type.id, user_group_has_checkout_type: @invalid_attrs
|
371
371
|
response.should redirect_to(new_user_session_url)
|
372
372
|
end
|
373
373
|
end
|
374
374
|
end
|
375
375
|
end
|
376
376
|
|
377
|
-
describe
|
377
|
+
describe 'DELETE destroy' do
|
378
378
|
before(:each) do
|
379
379
|
@user_group_has_checkout_type = FactoryGirl.create(:user_group_has_checkout_type)
|
380
380
|
end
|
381
381
|
|
382
|
-
describe
|
382
|
+
describe 'When logged in as Administrator' do
|
383
383
|
login_fixture_admin
|
384
384
|
|
385
|
-
it
|
386
|
-
delete :destroy, :
|
385
|
+
it 'destroys the requested user_group_has_checkout_type' do
|
386
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
387
387
|
end
|
388
388
|
|
389
|
-
it
|
390
|
-
delete :destroy, :
|
389
|
+
it 'redirects to the user_group_has_checkout_types list' do
|
390
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
391
391
|
response.should redirect_to(user_group_has_checkout_types_url)
|
392
392
|
end
|
393
393
|
end
|
394
394
|
|
395
|
-
describe
|
395
|
+
describe 'When logged in as Librarian' do
|
396
396
|
login_fixture_librarian
|
397
397
|
|
398
|
-
it
|
399
|
-
delete :destroy, :
|
398
|
+
it 'destroys the requested user_group_has_checkout_type' do
|
399
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
400
400
|
end
|
401
401
|
|
402
|
-
it
|
403
|
-
delete :destroy, :
|
402
|
+
it 'should be forbidden' do
|
403
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
404
404
|
response.should be_forbidden
|
405
405
|
end
|
406
406
|
end
|
407
407
|
|
408
|
-
describe
|
408
|
+
describe 'When logged in as User' do
|
409
409
|
login_fixture_user
|
410
410
|
|
411
|
-
it
|
412
|
-
delete :destroy, :
|
411
|
+
it 'destroys the requested user_group_has_checkout_type' do
|
412
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
413
413
|
end
|
414
414
|
|
415
|
-
it
|
416
|
-
delete :destroy, :
|
415
|
+
it 'should be forbidden' do
|
416
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
417
417
|
response.should be_forbidden
|
418
418
|
end
|
419
419
|
end
|
420
420
|
|
421
|
-
describe
|
422
|
-
it
|
423
|
-
delete :destroy, :
|
421
|
+
describe 'When not logged in' do
|
422
|
+
it 'destroys the requested user_group_has_checkout_type' do
|
423
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
424
424
|
end
|
425
425
|
|
426
|
-
it
|
427
|
-
delete :destroy, :
|
426
|
+
it 'should be forbidden' do
|
427
|
+
delete :destroy, id: @user_group_has_checkout_type.id
|
428
428
|
response.should redirect_to(new_user_session_url)
|
429
429
|
end
|
430
430
|
end
|