enju_library 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/controllers/concerns/enju_library/controller.rb +12 -3
- data/app/controllers/libraries_controller.rb +1 -0
- data/app/controllers/shelves_controller.rb +2 -1
- data/app/models/library.rb +1 -1
- data/app/models/library_group.rb +22 -17
- data/app/models/shelf.rb +1 -1
- data/app/views/libraries/_form.html.erb +1 -0
- data/app/views/library_groups/_color_fields.html.erb +0 -1
- data/app/views/library_groups/_form.html.erb +1 -4
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/config/routes.rb +1 -0
- data/lib/enju_library/version.rb +1 -1
- data/lib/tasks/enju_library_tasks.rake +2 -2
- data/spec/controllers/accepts_controller_spec.rb +96 -96
- data/spec/controllers/baskets_controller_spec.rb +126 -126
- data/spec/controllers/bookstores_controller_spec.rb +152 -152
- data/spec/controllers/budget_types_controller_spec.rb +48 -49
- data/spec/controllers/libraries_controller_spec.rb +183 -183
- data/spec/controllers/library_groups_controller_spec.rb +47 -47
- data/spec/controllers/request_status_types_controller_spec.rb +152 -152
- data/spec/controllers/request_types_controller_spec.rb +152 -152
- data/spec/controllers/search_engines_controller_spec.rb +152 -152
- data/spec/controllers/shelves_controller_spec.rb +152 -152
- data/spec/controllers/subscribes_controller_spec.rb +151 -151
- data/spec/controllers/subscriptions_controller_spec.rb +152 -152
- data/spec/controllers/user_export_files_controller_spec.rb +75 -75
- data/spec/controllers/user_groups_controller_spec.rb +108 -108
- data/spec/controllers/user_import_files_controller_spec.rb +73 -73
- data/spec/controllers/user_import_results_controller_spec.rb +33 -34
- data/spec/controllers/withdraws_controller_spec.rb +42 -45
- data/spec/fixtures/libraries.yml +1 -1
- data/spec/fixtures/library_groups.yml +22 -17
- data/spec/fixtures/shelves.yml +1 -1
- data/spec/models/library_group_spec.rb +22 -17
- data/spec/models/library_spec.rb +1 -1
- data/spec/models/shelf_spec.rb +1 -1
- data/spec/views/library_groups/edit.html.erb_spec.rb +8 -0
- metadata +11 -25
@@ -7,41 +7,41 @@ describe SubscribesController do
|
|
7
7
|
FactoryGirl.attributes_for(:subscribe)
|
8
8
|
end
|
9
9
|
|
10
|
-
describe
|
10
|
+
describe 'GET index' do
|
11
11
|
before(:each) do
|
12
12
|
FactoryGirl.create(:subscribe)
|
13
13
|
end
|
14
14
|
|
15
|
-
describe
|
15
|
+
describe 'When logged in as Administrator' do
|
16
16
|
login_fixture_admin
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'assigns all subscribes as @subscribes' do
|
19
19
|
get :index
|
20
20
|
assigns(:subscribes).should eq(Subscribe.page(1))
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
describe
|
24
|
+
describe 'When logged in as Librarian' do
|
25
25
|
login_fixture_librarian
|
26
26
|
|
27
|
-
it
|
27
|
+
it 'assigns all subscribes as @subscribes' do
|
28
28
|
get :index
|
29
29
|
assigns(:subscribes).should eq(Subscribe.page(1))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
describe
|
33
|
+
describe 'When logged in as User' do
|
34
34
|
login_fixture_user
|
35
35
|
|
36
|
-
it
|
36
|
+
it 'should be forbidden' do
|
37
37
|
get :index
|
38
38
|
assigns(:subscribes).should be_nil
|
39
39
|
response.should be_forbidden
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
describe
|
44
|
-
it
|
43
|
+
describe 'When not logged in' do
|
44
|
+
it 'assigns all subscribes as @subscribes' do
|
45
45
|
get :index
|
46
46
|
assigns(:subscribes).should be_nil
|
47
47
|
response.should redirect_to(new_user_session_url)
|
@@ -49,79 +49,79 @@ describe SubscribesController do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
describe
|
53
|
-
describe
|
52
|
+
describe 'GET show' do
|
53
|
+
describe 'When logged in as Administrator' do
|
54
54
|
login_fixture_admin
|
55
55
|
|
56
|
-
it
|
56
|
+
it 'assigns the requested subscribe as @subscribe' do
|
57
57
|
subscribe = FactoryGirl.create(:subscribe)
|
58
|
-
get :show, :
|
58
|
+
get :show, id: subscribe.id
|
59
59
|
assigns(:subscribe).should eq(subscribe)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
describe
|
63
|
+
describe 'When logged in as Librarian' do
|
64
64
|
login_fixture_librarian
|
65
65
|
|
66
|
-
it
|
66
|
+
it 'assigns the requested subscribe as @subscribe' do
|
67
67
|
subscribe = FactoryGirl.create(:subscribe)
|
68
|
-
get :show, :
|
68
|
+
get :show, id: subscribe.id
|
69
69
|
assigns(:subscribe).should eq(subscribe)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
describe
|
73
|
+
describe 'When logged in as User' do
|
74
74
|
login_fixture_user
|
75
75
|
|
76
|
-
it
|
76
|
+
it 'assigns the requested subscribe as @subscribe' do
|
77
77
|
subscribe = FactoryGirl.create(:subscribe)
|
78
|
-
get :show, :
|
78
|
+
get :show, id: subscribe.id
|
79
79
|
assigns(:subscribe).should eq(subscribe)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
84
|
-
it
|
83
|
+
describe 'When not logged in' do
|
84
|
+
it 'assigns the requested subscribe as @subscribe' do
|
85
85
|
subscribe = FactoryGirl.create(:subscribe)
|
86
|
-
get :show, :
|
86
|
+
get :show, id: subscribe.id
|
87
87
|
assigns(:subscribe).should eq(subscribe)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
describe
|
93
|
-
describe
|
92
|
+
describe 'GET new' do
|
93
|
+
describe 'When logged in as Administrator' do
|
94
94
|
login_fixture_admin
|
95
95
|
|
96
|
-
it
|
96
|
+
it 'assigns the requested subscribe as @subscribe' do
|
97
97
|
get :new
|
98
98
|
assigns(:subscribe).should_not be_valid
|
99
99
|
response.should be_success
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
describe
|
103
|
+
describe 'When logged in as Librarian' do
|
104
104
|
login_fixture_librarian
|
105
105
|
|
106
|
-
it
|
106
|
+
it 'assigns the requested subscribe as @subscribe' do
|
107
107
|
get :new
|
108
108
|
assigns(:subscribe).should_not be_valid
|
109
109
|
response.should be_success
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
describe
|
113
|
+
describe 'When logged in as User' do
|
114
114
|
login_fixture_user
|
115
115
|
|
116
|
-
it
|
116
|
+
it 'should not assign the requested subscribe as @subscribe' do
|
117
117
|
get :new
|
118
118
|
assigns(:subscribe).should be_nil
|
119
119
|
response.should be_forbidden
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
describe
|
124
|
-
it
|
123
|
+
describe 'When not logged in' do
|
124
|
+
it 'should not assign the requested subscribe as @subscribe' do
|
125
125
|
get :new
|
126
126
|
assigns(:subscribe).should be_nil
|
127
127
|
response.should redirect_to(new_user_session_url)
|
@@ -129,311 +129,311 @@ describe SubscribesController do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
describe
|
133
|
-
describe
|
132
|
+
describe 'GET edit' do
|
133
|
+
describe 'When logged in as Administrator' do
|
134
134
|
login_fixture_admin
|
135
135
|
|
136
|
-
it
|
136
|
+
it 'assigns the requested subscribe as @subscribe' do
|
137
137
|
subscribe = FactoryGirl.create(:subscribe)
|
138
|
-
get :edit, :
|
138
|
+
get :edit, id: subscribe.id
|
139
139
|
assigns(:subscribe).should eq(subscribe)
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
-
describe
|
143
|
+
describe 'When logged in as Librarian' do
|
144
144
|
login_fixture_librarian
|
145
145
|
|
146
|
-
it
|
146
|
+
it 'assigns the requested subscribe as @subscribe' do
|
147
147
|
subscribe = FactoryGirl.create(:subscribe)
|
148
|
-
get :edit, :
|
148
|
+
get :edit, id: subscribe.id
|
149
149
|
assigns(:subscribe).should eq(subscribe)
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
153
|
-
describe
|
153
|
+
describe 'When logged in as User' do
|
154
154
|
login_fixture_user
|
155
155
|
|
156
|
-
it
|
156
|
+
it 'assigns the requested subscribe as @subscribe' do
|
157
157
|
subscribe = FactoryGirl.create(:subscribe)
|
158
|
-
get :edit, :
|
158
|
+
get :edit, id: subscribe.id
|
159
159
|
response.should be_forbidden
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
-
describe
|
164
|
-
it
|
163
|
+
describe 'When not logged in' do
|
164
|
+
it 'should not assign the requested subscribe as @subscribe' do
|
165
165
|
subscribe = FactoryGirl.create(:subscribe)
|
166
|
-
get :edit, :
|
166
|
+
get :edit, id: subscribe.id
|
167
167
|
response.should redirect_to(new_user_session_url)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
|
-
describe
|
172
|
+
describe 'POST create' do
|
173
173
|
before(:each) do
|
174
174
|
@attrs = valid_attributes
|
175
|
-
@invalid_attrs = {:
|
175
|
+
@invalid_attrs = { work_id: '' }
|
176
176
|
end
|
177
177
|
|
178
|
-
describe
|
178
|
+
describe 'When logged in as Administrator' do
|
179
179
|
login_fixture_admin
|
180
180
|
|
181
|
-
describe
|
182
|
-
it
|
183
|
-
post :create, :
|
181
|
+
describe 'with valid params' do
|
182
|
+
it 'assigns a newly created subscribe as @subscribe' do
|
183
|
+
post :create, subscribe: @attrs
|
184
184
|
assigns(:subscribe).should be_valid
|
185
185
|
end
|
186
186
|
|
187
|
-
it
|
188
|
-
post :create, :
|
187
|
+
it 'redirects to the created agent' do
|
188
|
+
post :create, subscribe: @attrs
|
189
189
|
response.should redirect_to(assigns(:subscribe))
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
describe
|
194
|
-
it
|
195
|
-
post :create, :
|
193
|
+
describe 'with invalid params' do
|
194
|
+
it 'assigns a newly created but unsaved subscribe as @subscribe' do
|
195
|
+
post :create, subscribe: @invalid_attrs
|
196
196
|
assigns(:subscribe).should_not be_valid
|
197
197
|
end
|
198
198
|
|
199
199
|
it "re-renders the 'new' template" do
|
200
|
-
post :create, :
|
201
|
-
response.should render_template(
|
200
|
+
post :create, subscribe: @invalid_attrs
|
201
|
+
response.should render_template('new')
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
206
|
-
describe
|
206
|
+
describe 'When logged in as Librarian' do
|
207
207
|
login_fixture_librarian
|
208
208
|
|
209
|
-
describe
|
210
|
-
it
|
211
|
-
post :create, :
|
209
|
+
describe 'with valid params' do
|
210
|
+
it 'assigns a newly created subscribe as @subscribe' do
|
211
|
+
post :create, subscribe: @attrs
|
212
212
|
assigns(:subscribe).should be_valid
|
213
213
|
end
|
214
214
|
|
215
|
-
it
|
216
|
-
post :create, :
|
215
|
+
it 'redirects to the created agent' do
|
216
|
+
post :create, subscribe: @attrs
|
217
217
|
response.should redirect_to(assigns(:subscribe))
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
|
-
describe
|
222
|
-
it
|
223
|
-
post :create, :
|
221
|
+
describe 'with invalid params' do
|
222
|
+
it 'assigns a newly created but unsaved subscribe as @subscribe' do
|
223
|
+
post :create, subscribe: @invalid_attrs
|
224
224
|
assigns(:subscribe).should_not be_valid
|
225
225
|
end
|
226
226
|
|
227
227
|
it "re-renders the 'new' template" do
|
228
|
-
post :create, :
|
229
|
-
response.should render_template(
|
228
|
+
post :create, subscribe: @invalid_attrs
|
229
|
+
response.should render_template('new')
|
230
230
|
end
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
234
|
-
describe
|
234
|
+
describe 'When logged in as User' do
|
235
235
|
login_fixture_user
|
236
236
|
|
237
|
-
describe
|
238
|
-
it
|
239
|
-
post :create, :
|
237
|
+
describe 'with valid params' do
|
238
|
+
it 'assigns a newly created subscribe as @subscribe' do
|
239
|
+
post :create, subscribe: @attrs
|
240
240
|
assigns(:subscribe).should be_nil
|
241
241
|
end
|
242
242
|
|
243
|
-
it
|
244
|
-
post :create, :
|
243
|
+
it 'should be forbidden' do
|
244
|
+
post :create, subscribe: @attrs
|
245
245
|
response.should be_forbidden
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
|
-
describe
|
250
|
-
it
|
251
|
-
post :create, :
|
249
|
+
describe 'with invalid params' do
|
250
|
+
it 'assigns a newly created but unsaved subscribe as @subscribe' do
|
251
|
+
post :create, subscribe: @invalid_attrs
|
252
252
|
assigns(:subscribe).should be_nil
|
253
253
|
end
|
254
254
|
|
255
|
-
it
|
256
|
-
post :create, :
|
255
|
+
it 'should be forbidden' do
|
256
|
+
post :create, subscribe: @invalid_attrs
|
257
257
|
response.should be_forbidden
|
258
258
|
end
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
262
|
-
describe
|
263
|
-
describe
|
264
|
-
it
|
265
|
-
post :create, :
|
262
|
+
describe 'When not logged in' do
|
263
|
+
describe 'with valid params' do
|
264
|
+
it 'assigns a newly created subscribe as @subscribe' do
|
265
|
+
post :create, subscribe: @attrs
|
266
266
|
assigns(:subscribe).should be_nil
|
267
267
|
end
|
268
268
|
|
269
|
-
it
|
270
|
-
post :create, :
|
269
|
+
it 'should be forbidden' do
|
270
|
+
post :create, subscribe: @attrs
|
271
271
|
response.should redirect_to(new_user_session_url)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
275
|
-
describe
|
276
|
-
it
|
277
|
-
post :create, :
|
275
|
+
describe 'with invalid params' do
|
276
|
+
it 'assigns a newly created but unsaved subscribe as @subscribe' do
|
277
|
+
post :create, subscribe: @invalid_attrs
|
278
278
|
assigns(:subscribe).should be_nil
|
279
279
|
end
|
280
280
|
|
281
|
-
it
|
282
|
-
post :create, :
|
281
|
+
it 'should be forbidden' do
|
282
|
+
post :create, subscribe: @invalid_attrs
|
283
283
|
response.should redirect_to(new_user_session_url)
|
284
284
|
end
|
285
285
|
end
|
286
286
|
end
|
287
287
|
end
|
288
288
|
|
289
|
-
describe
|
289
|
+
describe 'PUT update' do
|
290
290
|
before(:each) do
|
291
291
|
@subscribe = FactoryGirl.create(:subscribe)
|
292
292
|
@attrs = valid_attributes
|
293
|
-
@invalid_attrs = {:
|
293
|
+
@invalid_attrs = { work_id: '' }
|
294
294
|
end
|
295
295
|
|
296
|
-
describe
|
296
|
+
describe 'When logged in as Administrator' do
|
297
297
|
login_fixture_admin
|
298
298
|
|
299
|
-
describe
|
300
|
-
it
|
301
|
-
put :update, :
|
299
|
+
describe 'with valid params' do
|
300
|
+
it 'updates the requested subscribe' do
|
301
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
302
302
|
end
|
303
303
|
|
304
|
-
it
|
305
|
-
put :update, :
|
304
|
+
it 'assigns the requested subscribe as @subscribe' do
|
305
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
306
306
|
assigns(:subscribe).should eq(@subscribe)
|
307
307
|
response.should redirect_to(@subscribe)
|
308
308
|
end
|
309
309
|
end
|
310
310
|
|
311
|
-
describe
|
312
|
-
it
|
313
|
-
put :update, :
|
314
|
-
response.should render_template(
|
311
|
+
describe 'with invalid params' do
|
312
|
+
it 'assigns the requested subscribe as @subscribe' do
|
313
|
+
put :update, id: @subscribe.id, subscribe: @invalid_attrs
|
314
|
+
response.should render_template('edit')
|
315
315
|
end
|
316
316
|
end
|
317
317
|
end
|
318
318
|
|
319
|
-
describe
|
319
|
+
describe 'When logged in as Librarian' do
|
320
320
|
login_fixture_librarian
|
321
321
|
|
322
|
-
describe
|
323
|
-
it
|
324
|
-
put :update, :
|
322
|
+
describe 'with valid params' do
|
323
|
+
it 'updates the requested subscribe' do
|
324
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
325
325
|
end
|
326
326
|
|
327
|
-
it
|
328
|
-
put :update, :
|
327
|
+
it 'assigns the requested subscribe as @subscribe' do
|
328
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
329
329
|
assigns(:subscribe).should eq(@subscribe)
|
330
330
|
response.should redirect_to(@subscribe)
|
331
331
|
end
|
332
332
|
end
|
333
333
|
|
334
|
-
describe
|
335
|
-
it
|
336
|
-
put :update, :
|
337
|
-
response.should render_template(
|
334
|
+
describe 'with invalid params' do
|
335
|
+
it 'assigns the requested subscribe as @subscribe' do
|
336
|
+
put :update, id: @subscribe.id, subscribe: @invalid_attrs
|
337
|
+
response.should render_template('edit')
|
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 subscribe' do
|
347
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
348
348
|
end
|
349
349
|
|
350
|
-
it
|
351
|
-
put :update, :
|
350
|
+
it 'assigns the requested subscribe as @subscribe' do
|
351
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
352
352
|
assigns(:subscribe).should eq(@subscribe)
|
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 subscribe as @subscribe' do
|
359
|
+
put :update, id: @subscribe.id, subscribe: @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 subscribe' do
|
368
|
+
put :update, id: @subscribe.id, subscribe: @attrs
|
369
369
|
end
|
370
370
|
|
371
|
-
it
|
372
|
-
put :update, :
|
371
|
+
it 'should be forbidden' do
|
372
|
+
put :update, id: @subscribe.id, subscribe: @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 subscribe as @subscribe' do
|
379
|
+
put :update, id: @subscribe.id, subscribe: @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
|
@subscribe = FactoryGirl.create(:subscribe)
|
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 subscribe' do
|
395
|
+
delete :destroy, id: @subscribe.id
|
396
396
|
end
|
397
397
|
|
398
|
-
it
|
399
|
-
delete :destroy, :
|
398
|
+
it 'redirects to the subscribes list' do
|
399
|
+
delete :destroy, id: @subscribe.id
|
400
400
|
response.should redirect_to(subscribes_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 subscribe' do
|
408
|
+
delete :destroy, id: @subscribe.id
|
409
409
|
end
|
410
410
|
|
411
|
-
it
|
412
|
-
delete :destroy, :
|
411
|
+
it 'redirects to the subscribes list' do
|
412
|
+
delete :destroy, id: @subscribe.id
|
413
413
|
response.should redirect_to(subscribes_url)
|
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 subscribe' do
|
421
|
+
delete :destroy, id: @subscribe.id
|
422
422
|
end
|
423
423
|
|
424
|
-
it
|
425
|
-
delete :destroy, :
|
424
|
+
it 'should be forbidden' do
|
425
|
+
delete :destroy, id: @subscribe.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 subscribe' do
|
432
|
+
delete :destroy, id: @subscribe.id
|
433
433
|
end
|
434
434
|
|
435
|
-
it
|
436
|
-
delete :destroy, :
|
435
|
+
it 'should be forbidden' do
|
436
|
+
delete :destroy, id: @subscribe.id
|
437
437
|
response.should redirect_to(new_user_session_url)
|
438
438
|
end
|
439
439
|
end
|