enju_subject 0.1.0.pre26 → 0.1.0.pre27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/classification_types_controller.rb +74 -4
- data/app/controllers/classifications_controller.rb +1 -1
- data/app/controllers/subject_heading_types_controller.rb +74 -4
- data/app/controllers/subject_types_controller.rb +74 -4
- data/app/controllers/subjects_controller.rb +1 -1
- data/app/models/classification.rb +1 -1
- data/app/models/enju_subject/ability.rb +4 -1
- data/app/models/subject.rb +1 -1
- data/app/views/classification_types/index.html.erb +13 -6
- data/app/views/classifications/index.html.erb +1 -0
- data/app/views/manifestations/_classification_detail.html.erb +1 -1
- data/app/views/subject_heading_types/index.html.erb +16 -7
- data/app/views/subject_heading_types/show.html.erb +5 -0
- data/app/views/subject_types/index.html.erb +15 -8
- data/app/views/subjects/_form.html.erb +4 -4
- data/app/views/subjects/index.html.erb +1 -0
- data/app/views/subjects/show.html.erb +5 -0
- data/lib/enju_subject/engine.rb +0 -1
- data/lib/enju_subject/manifestation.rb +15 -1
- data/lib/enju_subject/version.rb +1 -1
- data/lib/tasks/enju_subject_tasks.rake +12 -0
- data/lib/tasks/subject_heading_type.rb +6 -0
- data/lib/tasks/subject_type.rb +10 -0
- data/spec/controllers/classification_types_controller_spec.rb +51 -51
- data/spec/controllers/classifications_controller_spec.rb +26 -26
- data/spec/controllers/subject_heading_types_controller_spec.rb +24 -24
- data/spec/controllers/subject_types_controller_spec.rb +24 -24
- data/spec/controllers/subjects_controller_spec.rb +25 -25
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_14a +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001439 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001440 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001441 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001442 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001443 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001444 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001445 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001446 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001447 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001448 +0 -0
- metadata +28 -40
- data/spec/dummy/solr/default/data/index/segments_ya +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001223 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001224 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001225 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001226 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001227 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001228 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001229 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001230 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001231 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001232 +0 -0
@@ -19,7 +19,7 @@ describe ClassificationTypesController do
|
|
19
19
|
|
20
20
|
it "assigns all classification_types as @classification_types" do
|
21
21
|
get :index
|
22
|
-
assigns(:classification_types).
|
22
|
+
expect(assigns(:classification_types)).to eq(ClassificationType.all)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe ClassificationTypesController do
|
|
28
28
|
|
29
29
|
it "assigns all classification_types as @classification_types" do
|
30
30
|
get :index
|
31
|
-
assigns(:classification_types).
|
31
|
+
expect(assigns(:classification_types)).to eq(ClassificationType.all)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -37,14 +37,14 @@ describe ClassificationTypesController do
|
|
37
37
|
|
38
38
|
it "assigns all classification_types as @classification_types" do
|
39
39
|
get :index
|
40
|
-
assigns(:classification_types).
|
40
|
+
expect(assigns(:classification_types)).to eq(ClassificationType.all)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "When not logged in" do
|
45
45
|
it "assigns all classification_types as @classification_types" do
|
46
46
|
get :index
|
47
|
-
assigns(:classification_types).
|
47
|
+
expect(assigns(:classification_types)).to eq(ClassificationType.all)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -56,7 +56,7 @@ describe ClassificationTypesController do
|
|
56
56
|
it "assigns the requested classification_type as @classification_type" do
|
57
57
|
classification_type = FactoryGirl.create(:classification_type)
|
58
58
|
get :show, :id => classification_type.id
|
59
|
-
assigns(:classification_type).
|
59
|
+
expect(assigns(:classification_type)).to eq(classification_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -66,7 +66,7 @@ describe ClassificationTypesController do
|
|
66
66
|
it "assigns the requested classification_type as @classification_type" do
|
67
67
|
classification_type = FactoryGirl.create(:classification_type)
|
68
68
|
get :show, :id => classification_type.id
|
69
|
-
assigns(:classification_type).
|
69
|
+
expect(assigns(:classification_type)).to eq(classification_type)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -76,7 +76,7 @@ describe ClassificationTypesController do
|
|
76
76
|
it "assigns the requested classification_type as @classification_type" do
|
77
77
|
classification_type = FactoryGirl.create(:classification_type)
|
78
78
|
get :show, :id => classification_type.id
|
79
|
-
assigns(:classification_type).
|
79
|
+
expect(assigns(:classification_type)).to eq(classification_type)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -84,7 +84,7 @@ describe ClassificationTypesController do
|
|
84
84
|
it "assigns the requested classification_type as @classification_type" do
|
85
85
|
classification_type = FactoryGirl.create(:classification_type)
|
86
86
|
get :show, :id => classification_type.id
|
87
|
-
assigns(:classification_type).
|
87
|
+
expect(assigns(:classification_type)).to eq(classification_type)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -95,8 +95,8 @@ describe ClassificationTypesController do
|
|
95
95
|
|
96
96
|
it "assigns the requested classification_type as @classification_type" do
|
97
97
|
get :new
|
98
|
-
assigns(:classification_type).
|
99
|
-
response.
|
98
|
+
expect(assigns(:classification_type)).not_to be_valid
|
99
|
+
expect(response).to be_success
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -105,8 +105,8 @@ describe ClassificationTypesController do
|
|
105
105
|
|
106
106
|
it "should not assign the requested classification_type as @classification_type" do
|
107
107
|
get :new
|
108
|
-
assigns(:classification_type).
|
109
|
-
response.
|
108
|
+
expect(assigns(:classification_type)).not_to be_valid
|
109
|
+
expect(response).to be_forbidden
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -115,16 +115,16 @@ describe ClassificationTypesController do
|
|
115
115
|
|
116
116
|
it "should not assign the requested classification_type as @classification_type" do
|
117
117
|
get :new
|
118
|
-
assigns(:classification_type).
|
119
|
-
response.
|
118
|
+
expect(assigns(:classification_type)).not_to be_valid
|
119
|
+
expect(response).to be_forbidden
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
123
|
describe "When not logged in" do
|
124
124
|
it "should not assign the requested classification_type as @classification_type" do
|
125
125
|
get :new
|
126
|
-
assigns(:classification_type).
|
127
|
-
response.
|
126
|
+
expect(assigns(:classification_type)).not_to be_valid
|
127
|
+
expect(response).to redirect_to(new_user_session_url)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
@@ -136,7 +136,7 @@ describe ClassificationTypesController do
|
|
136
136
|
it "assigns the requested classification_type as @classification_type" do
|
137
137
|
classification_type = FactoryGirl.create(:classification_type)
|
138
138
|
get :edit, :id => classification_type.id
|
139
|
-
assigns(:classification_type).
|
139
|
+
expect(assigns(:classification_type)).to eq(classification_type)
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -146,7 +146,7 @@ describe ClassificationTypesController do
|
|
146
146
|
it "assigns the requested classification_type as @classification_type" do
|
147
147
|
classification_type = FactoryGirl.create(:classification_type)
|
148
148
|
get :edit, :id => classification_type.id
|
149
|
-
response.
|
149
|
+
expect(response).to be_forbidden
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
@@ -156,7 +156,7 @@ describe ClassificationTypesController do
|
|
156
156
|
it "assigns the requested classification_type as @classification_type" do
|
157
157
|
classification_type = FactoryGirl.create(:classification_type)
|
158
158
|
get :edit, :id => classification_type.id
|
159
|
-
response.
|
159
|
+
expect(response).to be_forbidden
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
@@ -164,7 +164,7 @@ describe ClassificationTypesController do
|
|
164
164
|
it "should not assign the requested classification_type as @classification_type" do
|
165
165
|
classification_type = FactoryGirl.create(:classification_type)
|
166
166
|
get :edit, :id => classification_type.id
|
167
|
-
response.
|
167
|
+
expect(response).to redirect_to(new_user_session_url)
|
168
168
|
end
|
169
169
|
end
|
170
170
|
end
|
@@ -181,24 +181,24 @@ describe ClassificationTypesController do
|
|
181
181
|
describe "with valid params" do
|
182
182
|
it "assigns a newly created classification_type as @classification_type" do
|
183
183
|
post :create, :classification_type => @attrs
|
184
|
-
assigns(:classification_type).
|
184
|
+
expect(assigns(:classification_type)).to be_valid
|
185
185
|
end
|
186
186
|
|
187
187
|
it "redirects to the created agent" do
|
188
188
|
post :create, :classification_type => @attrs
|
189
|
-
response.
|
189
|
+
expect(response).to redirect_to(assigns(:classification_type))
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
193
|
describe "with invalid params" do
|
194
194
|
it "assigns a newly created but unsaved classification_type as @classification_type" do
|
195
195
|
post :create, :classification_type => @invalid_attrs
|
196
|
-
assigns(:classification_type).
|
196
|
+
expect(assigns(:classification_type)).not_to be_valid
|
197
197
|
end
|
198
198
|
|
199
199
|
it "should be successful" do
|
200
200
|
post :create, :classification_type => @invalid_attrs
|
201
|
-
response.
|
201
|
+
expect(response).to be_success
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
@@ -209,24 +209,24 @@ describe ClassificationTypesController do
|
|
209
209
|
describe "with valid params" do
|
210
210
|
it "assigns a newly created classification_type as @classification_type" do
|
211
211
|
post :create, :classification_type => @attrs
|
212
|
-
assigns(:classification_type).
|
212
|
+
expect(assigns(:classification_type)).to be_valid
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should be forbidden" do
|
216
216
|
post :create, :classification_type => @attrs
|
217
|
-
response.
|
217
|
+
expect(response).to be_forbidden
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
221
|
describe "with invalid params" do
|
222
222
|
it "assigns a newly created but unsaved classification_type as @classification_type" do
|
223
223
|
post :create, :classification_type => @invalid_attrs
|
224
|
-
assigns(:classification_type).
|
224
|
+
expect(assigns(:classification_type)).not_to be_valid
|
225
225
|
end
|
226
226
|
|
227
227
|
it "should be forbidden" do
|
228
228
|
post :create, :classification_type => @invalid_attrs
|
229
|
-
response.
|
229
|
+
expect(response).to be_forbidden
|
230
230
|
end
|
231
231
|
end
|
232
232
|
end
|
@@ -237,24 +237,24 @@ describe ClassificationTypesController do
|
|
237
237
|
describe "with valid params" do
|
238
238
|
it "assigns a newly created classification_type as @classification_type" do
|
239
239
|
post :create, :classification_type => @attrs
|
240
|
-
assigns(:classification_type).
|
240
|
+
expect(assigns(:classification_type)).to be_valid
|
241
241
|
end
|
242
242
|
|
243
243
|
it "should be forbidden" do
|
244
244
|
post :create, :classification_type => @attrs
|
245
|
-
response.
|
245
|
+
expect(response).to be_forbidden
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
249
|
describe "with invalid params" do
|
250
250
|
it "assigns a newly created but unsaved classification_type as @classification_type" do
|
251
251
|
post :create, :classification_type => @invalid_attrs
|
252
|
-
assigns(:classification_type).
|
252
|
+
expect(assigns(:classification_type)).not_to be_valid
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should be forbidden" do
|
256
256
|
post :create, :classification_type => @invalid_attrs
|
257
|
-
response.
|
257
|
+
expect(response).to be_forbidden
|
258
258
|
end
|
259
259
|
end
|
260
260
|
end
|
@@ -263,24 +263,24 @@ describe ClassificationTypesController do
|
|
263
263
|
describe "with valid params" do
|
264
264
|
it "assigns a newly created classification_type as @classification_type" do
|
265
265
|
post :create, :classification_type => @attrs
|
266
|
-
assigns(:classification_type).
|
266
|
+
expect(assigns(:classification_type)).to be_valid
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should be forbidden" do
|
270
270
|
post :create, :classification_type => @attrs
|
271
|
-
response.
|
271
|
+
expect(response).to redirect_to(new_user_session_url)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
275
275
|
describe "with invalid params" do
|
276
276
|
it "assigns a newly created but unsaved classification_type as @classification_type" do
|
277
277
|
post :create, :classification_type => @invalid_attrs
|
278
|
-
assigns(:classification_type).
|
278
|
+
expect(assigns(:classification_type)).not_to be_valid
|
279
279
|
end
|
280
280
|
|
281
281
|
it "should be forbidden" do
|
282
282
|
post :create, :classification_type => @invalid_attrs
|
283
|
-
response.
|
283
|
+
expect(response).to redirect_to(new_user_session_url)
|
284
284
|
end
|
285
285
|
end
|
286
286
|
end
|
@@ -303,19 +303,19 @@ describe ClassificationTypesController do
|
|
303
303
|
|
304
304
|
it "assigns the requested classification_type as @classification_type" do
|
305
305
|
put :update, :id => @classification_type.id, :classification_type => @attrs
|
306
|
-
assigns(:classification_type).
|
306
|
+
expect(assigns(:classification_type)).to eq(@classification_type)
|
307
307
|
end
|
308
308
|
|
309
309
|
it "moves its position when specified" do
|
310
310
|
put :update, :id => @classification_type.id, :classification_type => @attrs, :move => 'lower'
|
311
|
-
response.
|
311
|
+
expect(response).to redirect_to(classification_types_url)
|
312
312
|
end
|
313
313
|
end
|
314
314
|
|
315
315
|
describe "with invalid params" do
|
316
316
|
it "assigns the requested classification_type as @classification_type" do
|
317
317
|
put :update, :id => @classification_type.id, :classification_type => @invalid_attrs
|
318
|
-
response.
|
318
|
+
expect(response).to render_template("edit")
|
319
319
|
end
|
320
320
|
end
|
321
321
|
end
|
@@ -330,15 +330,15 @@ describe ClassificationTypesController do
|
|
330
330
|
|
331
331
|
it "assigns the requested classification_type as @classification_type" do
|
332
332
|
put :update, :id => @classification_type.id, :classification_type => @attrs
|
333
|
-
assigns(:classification_type).
|
334
|
-
response.
|
333
|
+
expect(assigns(:classification_type)).to eq(@classification_type)
|
334
|
+
expect(response).to be_forbidden
|
335
335
|
end
|
336
336
|
end
|
337
337
|
|
338
338
|
describe "with invalid params" do
|
339
339
|
it "assigns the requested classification_type as @classification_type" do
|
340
340
|
put :update, :id => @classification_type.id, :classification_type => @invalid_attrs
|
341
|
-
response.
|
341
|
+
expect(response).to be_forbidden
|
342
342
|
end
|
343
343
|
end
|
344
344
|
end
|
@@ -353,15 +353,15 @@ describe ClassificationTypesController do
|
|
353
353
|
|
354
354
|
it "assigns the requested classification_type as @classification_type" do
|
355
355
|
put :update, :id => @classification_type.id, :classification_type => @attrs
|
356
|
-
assigns(:classification_type).
|
357
|
-
response.
|
356
|
+
expect(assigns(:classification_type)).to eq(@classification_type)
|
357
|
+
expect(response).to be_forbidden
|
358
358
|
end
|
359
359
|
end
|
360
360
|
|
361
361
|
describe "with invalid params" do
|
362
362
|
it "assigns the requested classification_type as @classification_type" do
|
363
363
|
put :update, :id => @classification_type.id, :classification_type => @invalid_attrs
|
364
|
-
response.
|
364
|
+
expect(response).to be_forbidden
|
365
365
|
end
|
366
366
|
end
|
367
367
|
end
|
@@ -374,14 +374,14 @@ describe ClassificationTypesController do
|
|
374
374
|
|
375
375
|
it "should be forbidden" do
|
376
376
|
put :update, :id => @classification_type.id, :classification_type => @attrs
|
377
|
-
response.
|
377
|
+
expect(response).to redirect_to(new_user_session_url)
|
378
378
|
end
|
379
379
|
end
|
380
380
|
|
381
381
|
describe "with invalid params" do
|
382
382
|
it "assigns the requested classification_type as @classification_type" do
|
383
383
|
put :update, :id => @classification_type.id, :classification_type => @invalid_attrs
|
384
|
-
response.
|
384
|
+
expect(response).to redirect_to(new_user_session_url)
|
385
385
|
end
|
386
386
|
end
|
387
387
|
end
|
@@ -401,7 +401,7 @@ describe ClassificationTypesController do
|
|
401
401
|
|
402
402
|
it "redirects to the classification_types list" do
|
403
403
|
delete :destroy, :id => @classification_type.id
|
404
|
-
response.
|
404
|
+
expect(response).to redirect_to(classification_types_url)
|
405
405
|
end
|
406
406
|
end
|
407
407
|
|
@@ -414,7 +414,7 @@ describe ClassificationTypesController do
|
|
414
414
|
|
415
415
|
it "should be forbidden" do
|
416
416
|
delete :destroy, :id => @classification_type.id
|
417
|
-
response.
|
417
|
+
expect(response).to be_forbidden
|
418
418
|
end
|
419
419
|
end
|
420
420
|
|
@@ -427,7 +427,7 @@ describe ClassificationTypesController do
|
|
427
427
|
|
428
428
|
it "should be forbidden" do
|
429
429
|
delete :destroy, :id => @classification_type.id
|
430
|
-
response.
|
430
|
+
expect(response).to be_forbidden
|
431
431
|
end
|
432
432
|
end
|
433
433
|
|
@@ -438,7 +438,7 @@ describe ClassificationTypesController do
|
|
438
438
|
|
439
439
|
it "should be forbidden" do
|
440
440
|
delete :destroy, :id => @classification_type.id
|
441
|
-
response.
|
441
|
+
expect(response).to redirect_to(new_user_session_url)
|
442
442
|
end
|
443
443
|
end
|
444
444
|
end
|
@@ -17,7 +17,7 @@ describe ClassificationsController do
|
|
17
17
|
|
18
18
|
it "assigns all classifications as @classifications" do
|
19
19
|
get :index
|
20
|
-
assigns(:classifications).
|
20
|
+
expect(assigns(:classifications)).not_to be_empty
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,7 +26,7 @@ describe ClassificationsController do
|
|
26
26
|
|
27
27
|
it "assigns all classifications as @classifications" do
|
28
28
|
get :index
|
29
|
-
assigns(:classifications).
|
29
|
+
expect(assigns(:classifications)).not_to be_empty
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,20 +35,20 @@ describe ClassificationsController do
|
|
35
35
|
|
36
36
|
it "assigns all classifications as @classifications" do
|
37
37
|
get :index
|
38
|
-
assigns(:classifications).
|
38
|
+
expect(assigns(:classifications)).not_to be_empty
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "When not logged in" do
|
43
43
|
it "assigns all classifications as @classifications" do
|
44
44
|
get :index
|
45
|
-
assigns(:classifications).
|
45
|
+
expect(assigns(:classifications)).not_to be_empty
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should get index with query" do
|
49
49
|
get :index, :query => '500'
|
50
50
|
response.should be_success
|
51
|
-
assigns(:classifications).
|
51
|
+
expect(assigns(:classifications)).not_to be_empty
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -63,7 +63,7 @@ describe ClassificationsController do
|
|
63
63
|
|
64
64
|
it "assigns the requested classification as @classification" do
|
65
65
|
get :show, :id => @classification.id
|
66
|
-
assigns(:classification).
|
66
|
+
expect(assigns(:classification)).to eq(@classification)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -72,7 +72,7 @@ describe ClassificationsController do
|
|
72
72
|
|
73
73
|
it "assigns the requested classification as @classification" do
|
74
74
|
get :show, :id => @classification.id
|
75
|
-
assigns(:classification).
|
75
|
+
expect(assigns(:classification)).to eq(@classification)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -81,14 +81,14 @@ describe ClassificationsController do
|
|
81
81
|
|
82
82
|
it "assigns the requested classification as @classification" do
|
83
83
|
get :show, :id => @classification.id
|
84
|
-
assigns(:classification).
|
84
|
+
expect(assigns(:classification)).to eq(@classification)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
describe "When not logged in" do
|
89
89
|
it "assigns the requested classification as @classification" do
|
90
90
|
get :show, :id => @classification.id
|
91
|
-
assigns(:classification).
|
91
|
+
expect(assigns(:classification)).to eq(@classification)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -99,7 +99,7 @@ describe ClassificationsController do
|
|
99
99
|
|
100
100
|
it "assigns the requested classification as @classification" do
|
101
101
|
get :new
|
102
|
-
assigns(:classification).
|
102
|
+
expect(assigns(:classification)).not_to be_valid
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
@@ -108,7 +108,7 @@ describe ClassificationsController do
|
|
108
108
|
|
109
109
|
it "assigns the requested classification as @classification" do
|
110
110
|
get :new
|
111
|
-
assigns(:classification).
|
111
|
+
expect(assigns(:classification)).not_to be_valid
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
@@ -117,14 +117,14 @@ describe ClassificationsController do
|
|
117
117
|
|
118
118
|
it "should assign the requested classification as @classification" do
|
119
119
|
get :new
|
120
|
-
assigns(:classification).
|
120
|
+
expect(assigns(:classification)).not_to be_valid
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
124
|
describe "When not logged in" do
|
125
125
|
it "should not assign the requested classification as @classification" do
|
126
126
|
get :new
|
127
|
-
assigns(:classification).
|
127
|
+
expect(assigns(:classification)).not_to be_valid
|
128
128
|
response.should redirect_to(new_user_session_url)
|
129
129
|
end
|
130
130
|
end
|
@@ -137,7 +137,7 @@ describe ClassificationsController do
|
|
137
137
|
it "assigns the requested classification as @classification" do
|
138
138
|
classification = FactoryGirl.create(:classification)
|
139
139
|
get :edit, :id => classification.id
|
140
|
-
assigns(:classification).
|
140
|
+
expect(assigns(:classification)).to eq(classification)
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
@@ -147,7 +147,7 @@ describe ClassificationsController do
|
|
147
147
|
it "assigns the requested classification as @classification" do
|
148
148
|
classification = FactoryGirl.create(:classification)
|
149
149
|
get :edit, :id => classification.id
|
150
|
-
assigns(:classification).
|
150
|
+
expect(assigns(:classification)).to eq(classification)
|
151
151
|
end
|
152
152
|
end
|
153
153
|
|
@@ -182,7 +182,7 @@ describe ClassificationsController do
|
|
182
182
|
describe "with valid params" do
|
183
183
|
it "assigns a newly created classification as @classification" do
|
184
184
|
post :create, :classification => @attrs
|
185
|
-
assigns(:classification).
|
185
|
+
expect(assigns(:classification)).to be_valid
|
186
186
|
end
|
187
187
|
|
188
188
|
it "redirects to the created classification" do
|
@@ -194,7 +194,7 @@ describe ClassificationsController do
|
|
194
194
|
describe "with invalid params" do
|
195
195
|
it "assigns a newly created but unsaved classification as @classification" do
|
196
196
|
post :create, :classification => @invalid_attrs
|
197
|
-
assigns(:classification).
|
197
|
+
expect(assigns(:classification)).not_to be_valid
|
198
198
|
end
|
199
199
|
|
200
200
|
it "re-renders the 'new' template" do
|
@@ -210,7 +210,7 @@ describe ClassificationsController do
|
|
210
210
|
describe "with valid params" do
|
211
211
|
it "assigns a newly created classification as @classification" do
|
212
212
|
post :create, :classification => @attrs
|
213
|
-
assigns(:classification).
|
213
|
+
expect(assigns(:classification)).to be_valid
|
214
214
|
end
|
215
215
|
|
216
216
|
it "should be forbidden" do
|
@@ -222,7 +222,7 @@ describe ClassificationsController do
|
|
222
222
|
describe "with invalid params" do
|
223
223
|
it "assigns a newly created but unsaved classification as @classification" do
|
224
224
|
post :create, :classification => @invalid_attrs
|
225
|
-
assigns(:classification).
|
225
|
+
expect(assigns(:classification)).not_to be_valid
|
226
226
|
end
|
227
227
|
|
228
228
|
it "should be forbidden" do
|
@@ -238,7 +238,7 @@ describe ClassificationsController do
|
|
238
238
|
describe "with valid params" do
|
239
239
|
it "assigns a newly created classification as @classification" do
|
240
240
|
post :create, :classification => @attrs
|
241
|
-
assigns(:classification).
|
241
|
+
expect(assigns(:classification)).to be_valid
|
242
242
|
end
|
243
243
|
|
244
244
|
it "should be forbidden" do
|
@@ -250,7 +250,7 @@ describe ClassificationsController do
|
|
250
250
|
describe "with invalid params" do
|
251
251
|
it "assigns a newly created but unsaved classification as @classification" do
|
252
252
|
post :create, :classification => @invalid_attrs
|
253
|
-
assigns(:classification).
|
253
|
+
expect(assigns(:classification)).not_to be_valid
|
254
254
|
end
|
255
255
|
|
256
256
|
it "should be forbidden" do
|
@@ -264,7 +264,7 @@ describe ClassificationsController do
|
|
264
264
|
describe "with valid params" do
|
265
265
|
it "assigns a newly created classification as @classification" do
|
266
266
|
post :create, :classification => @attrs
|
267
|
-
assigns(:classification).
|
267
|
+
expect(assigns(:classification)).to be_valid
|
268
268
|
end
|
269
269
|
|
270
270
|
it "should be forbidden" do
|
@@ -276,7 +276,7 @@ describe ClassificationsController do
|
|
276
276
|
describe "with invalid params" do
|
277
277
|
it "assigns a newly created but unsaved classification as @classification" do
|
278
278
|
post :create, :classification => @invalid_attrs
|
279
|
-
assigns(:classification).
|
279
|
+
expect(assigns(:classification)).not_to be_valid
|
280
280
|
end
|
281
281
|
|
282
282
|
it "should be forbidden" do
|
@@ -304,7 +304,7 @@ describe ClassificationsController do
|
|
304
304
|
|
305
305
|
it "assigns the requested classification as @classification" do
|
306
306
|
put :update, :id => @classification.id, :classification => @attrs
|
307
|
-
assigns(:classification).
|
307
|
+
expect(assigns(:classification)).to eq(@classification)
|
308
308
|
end
|
309
309
|
end
|
310
310
|
|
@@ -326,7 +326,7 @@ describe ClassificationsController do
|
|
326
326
|
|
327
327
|
it "should be forbidden" do
|
328
328
|
put :update, :id => @classification.id, :classification => @attrs
|
329
|
-
assigns(:classification).
|
329
|
+
expect(assigns(:classification)).to eq(@classification)
|
330
330
|
response.should be_forbidden
|
331
331
|
end
|
332
332
|
end
|
@@ -349,7 +349,7 @@ describe ClassificationsController do
|
|
349
349
|
|
350
350
|
it "assigns the requested classification as @classification" do
|
351
351
|
put :update, :id => @classification.id, :classification => @attrs
|
352
|
-
assigns(:classification).
|
352
|
+
expect(assigns(:classification)).to eq(@classification)
|
353
353
|
response.should be_forbidden
|
354
354
|
end
|
355
355
|
end
|