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