enju_subject 0.1.0.pre26 → 0.1.0.pre27
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/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 SubjectHeadingTypesController do
|
|
19
19
|
|
20
20
|
it "assigns all subject_heading_types as @subject_heading_types" do
|
21
21
|
get :index
|
22
|
-
assigns(:subject_heading_types).
|
22
|
+
expect(assigns(:subject_heading_types)).to eq(SubjectHeadingType.all)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe SubjectHeadingTypesController do
|
|
28
28
|
|
29
29
|
it "assigns all subject_heading_types as @subject_heading_types" do
|
30
30
|
get :index
|
31
|
-
assigns(:subject_heading_types).
|
31
|
+
expect(assigns(:subject_heading_types)).to eq(SubjectHeadingType.all)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -37,14 +37,14 @@ describe SubjectHeadingTypesController do
|
|
37
37
|
|
38
38
|
it "assigns all subject_heading_types as @subject_heading_types" do
|
39
39
|
get :index
|
40
|
-
assigns(:subject_heading_types).
|
40
|
+
expect(assigns(:subject_heading_types)).to eq(SubjectHeadingType.all)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "When not logged in" do
|
45
45
|
it "assigns all subject_heading_types as @subject_heading_types" do
|
46
46
|
get :index
|
47
|
-
assigns(:subject_heading_types).
|
47
|
+
expect(assigns(:subject_heading_types)).to eq(SubjectHeadingType.all)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -56,7 +56,7 @@ describe SubjectHeadingTypesController do
|
|
56
56
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
57
57
|
subject_heading_type = FactoryGirl.create(:subject_heading_type)
|
58
58
|
get :show, :id => subject_heading_type.id
|
59
|
-
assigns(:subject_heading_type).
|
59
|
+
expect(assigns(:subject_heading_type)).to eq(subject_heading_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -66,7 +66,7 @@ describe SubjectHeadingTypesController do
|
|
66
66
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
67
67
|
subject_heading_type = FactoryGirl.create(:subject_heading_type)
|
68
68
|
get :show, :id => subject_heading_type.id
|
69
|
-
assigns(:subject_heading_type).
|
69
|
+
expect(assigns(:subject_heading_type)).to eq(subject_heading_type)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -76,7 +76,7 @@ describe SubjectHeadingTypesController do
|
|
76
76
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
77
77
|
subject_heading_type = FactoryGirl.create(:subject_heading_type)
|
78
78
|
get :show, :id => subject_heading_type.id
|
79
|
-
assigns(:subject_heading_type).
|
79
|
+
expect(assigns(:subject_heading_type)).to eq(subject_heading_type)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -84,7 +84,7 @@ describe SubjectHeadingTypesController do
|
|
84
84
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
85
85
|
subject_heading_type = FactoryGirl.create(:subject_heading_type)
|
86
86
|
get :show, :id => subject_heading_type.id
|
87
|
-
assigns(:subject_heading_type).
|
87
|
+
expect(assigns(:subject_heading_type)).to eq(subject_heading_type)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -95,7 +95,7 @@ describe SubjectHeadingTypesController do
|
|
95
95
|
|
96
96
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
97
97
|
get :new
|
98
|
-
assigns(:subject_heading_type).
|
98
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
99
99
|
response.should be_success
|
100
100
|
end
|
101
101
|
end
|
@@ -105,7 +105,7 @@ describe SubjectHeadingTypesController do
|
|
105
105
|
|
106
106
|
it "should not assign the requested subject_heading_type as @subject_heading_type" do
|
107
107
|
get :new
|
108
|
-
assigns(:subject_heading_type).
|
108
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
109
109
|
response.should be_forbidden
|
110
110
|
end
|
111
111
|
end
|
@@ -115,7 +115,7 @@ describe SubjectHeadingTypesController do
|
|
115
115
|
|
116
116
|
it "should not assign the requested subject_heading_type as @subject_heading_type" do
|
117
117
|
get :new
|
118
|
-
assigns(:subject_heading_type).
|
118
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
119
119
|
response.should be_forbidden
|
120
120
|
end
|
121
121
|
end
|
@@ -123,7 +123,7 @@ describe SubjectHeadingTypesController do
|
|
123
123
|
describe "When not logged in" do
|
124
124
|
it "should not assign the requested subject_heading_type as @subject_heading_type" do
|
125
125
|
get :new
|
126
|
-
assigns(:subject_heading_type).
|
126
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
127
127
|
response.should redirect_to(new_user_session_url)
|
128
128
|
end
|
129
129
|
end
|
@@ -136,7 +136,7 @@ describe SubjectHeadingTypesController do
|
|
136
136
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
137
137
|
subject_heading_type = FactoryGirl.create(:subject_heading_type)
|
138
138
|
get :edit, :id => subject_heading_type.id
|
139
|
-
assigns(:subject_heading_type).
|
139
|
+
expect(assigns(:subject_heading_type)).to eq(subject_heading_type)
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -181,7 +181,7 @@ describe SubjectHeadingTypesController do
|
|
181
181
|
describe "with valid params" do
|
182
182
|
it "assigns a newly created subject_heading_type as @subject_heading_type" do
|
183
183
|
post :create, :subject_heading_type => @attrs
|
184
|
-
assigns(:subject_heading_type).
|
184
|
+
expect(assigns(:subject_heading_type)).to be_valid
|
185
185
|
end
|
186
186
|
|
187
187
|
it "redirects to the created agent" do
|
@@ -193,7 +193,7 @@ describe SubjectHeadingTypesController do
|
|
193
193
|
describe "with invalid params" do
|
194
194
|
it "assigns a newly created but unsaved subject_heading_type as @subject_heading_type" do
|
195
195
|
post :create, :subject_heading_type => @invalid_attrs
|
196
|
-
assigns(:subject_heading_type).
|
196
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
197
197
|
end
|
198
198
|
|
199
199
|
it "should be successful" do
|
@@ -209,7 +209,7 @@ describe SubjectHeadingTypesController do
|
|
209
209
|
describe "with valid params" do
|
210
210
|
it "assigns a newly created subject_heading_type as @subject_heading_type" do
|
211
211
|
post :create, :subject_heading_type => @attrs
|
212
|
-
assigns(:subject_heading_type).
|
212
|
+
expect(assigns(:subject_heading_type)).to be_valid
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should be forbidden" do
|
@@ -221,7 +221,7 @@ describe SubjectHeadingTypesController do
|
|
221
221
|
describe "with invalid params" do
|
222
222
|
it "assigns a newly created but unsaved subject_heading_type as @subject_heading_type" do
|
223
223
|
post :create, :subject_heading_type => @invalid_attrs
|
224
|
-
assigns(:subject_heading_type).
|
224
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
225
225
|
end
|
226
226
|
|
227
227
|
it "should be forbidden" do
|
@@ -237,7 +237,7 @@ describe SubjectHeadingTypesController do
|
|
237
237
|
describe "with valid params" do
|
238
238
|
it "assigns a newly created subject_heading_type as @subject_heading_type" do
|
239
239
|
post :create, :subject_heading_type => @attrs
|
240
|
-
assigns(:subject_heading_type).
|
240
|
+
expect(assigns(:subject_heading_type)).to be_valid
|
241
241
|
end
|
242
242
|
|
243
243
|
it "should be forbidden" do
|
@@ -249,7 +249,7 @@ describe SubjectHeadingTypesController do
|
|
249
249
|
describe "with invalid params" do
|
250
250
|
it "assigns a newly created but unsaved subject_heading_type as @subject_heading_type" do
|
251
251
|
post :create, :subject_heading_type => @invalid_attrs
|
252
|
-
assigns(:subject_heading_type).
|
252
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should be forbidden" do
|
@@ -263,7 +263,7 @@ describe SubjectHeadingTypesController do
|
|
263
263
|
describe "with valid params" do
|
264
264
|
it "assigns a newly created subject_heading_type as @subject_heading_type" do
|
265
265
|
post :create, :subject_heading_type => @attrs
|
266
|
-
assigns(:subject_heading_type).
|
266
|
+
expect(assigns(:subject_heading_type)).to be_valid
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should be forbidden" do
|
@@ -275,7 +275,7 @@ describe SubjectHeadingTypesController do
|
|
275
275
|
describe "with invalid params" do
|
276
276
|
it "assigns a newly created but unsaved subject_heading_type as @subject_heading_type" do
|
277
277
|
post :create, :subject_heading_type => @invalid_attrs
|
278
|
-
assigns(:subject_heading_type).
|
278
|
+
expect(assigns(:subject_heading_type)).not_to be_valid
|
279
279
|
end
|
280
280
|
|
281
281
|
it "should be forbidden" do
|
@@ -303,7 +303,7 @@ describe SubjectHeadingTypesController do
|
|
303
303
|
|
304
304
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
305
305
|
put :update, :id => @subject_heading_type.id, :subject_heading_type => @attrs
|
306
|
-
assigns(:subject_heading_type).
|
306
|
+
expect(assigns(:subject_heading_type)).to eq(@subject_heading_type)
|
307
307
|
end
|
308
308
|
|
309
309
|
it "moves its position when specified" do
|
@@ -330,7 +330,7 @@ describe SubjectHeadingTypesController do
|
|
330
330
|
|
331
331
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
332
332
|
put :update, :id => @subject_heading_type.id, :subject_heading_type => @attrs
|
333
|
-
assigns(:subject_heading_type).
|
333
|
+
expect(assigns(:subject_heading_type)).to eq(@subject_heading_type)
|
334
334
|
response.should be_forbidden
|
335
335
|
end
|
336
336
|
end
|
@@ -353,7 +353,7 @@ describe SubjectHeadingTypesController do
|
|
353
353
|
|
354
354
|
it "assigns the requested subject_heading_type as @subject_heading_type" do
|
355
355
|
put :update, :id => @subject_heading_type.id, :subject_heading_type => @attrs
|
356
|
-
assigns(:subject_heading_type).
|
356
|
+
expect(assigns(:subject_heading_type)).to eq(@subject_heading_type)
|
357
357
|
response.should be_forbidden
|
358
358
|
end
|
359
359
|
end
|
@@ -19,7 +19,7 @@ describe SubjectTypesController do
|
|
19
19
|
|
20
20
|
it "assigns all subject_types as @subject_types" do
|
21
21
|
get :index
|
22
|
-
assigns(:subject_types).
|
22
|
+
expect(assigns(:subject_types)).to eq(SubjectType.all)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe SubjectTypesController do
|
|
28
28
|
|
29
29
|
it "assigns all subject_types as @subject_types" do
|
30
30
|
get :index
|
31
|
-
assigns(:subject_types).
|
31
|
+
expect(assigns(:subject_types)).to eq(SubjectType.all)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -37,7 +37,7 @@ describe SubjectTypesController do
|
|
37
37
|
|
38
38
|
it "assigns all subject_types as @subject_types" do
|
39
39
|
get :index
|
40
|
-
assigns(:subject_types).
|
40
|
+
expect(assigns(:subject_types)).to be_empty
|
41
41
|
response.should be_forbidden
|
42
42
|
end
|
43
43
|
end
|
@@ -45,7 +45,7 @@ describe SubjectTypesController do
|
|
45
45
|
describe "When not logged in" do
|
46
46
|
it "assigns all subject_types as @subject_types" do
|
47
47
|
get :index
|
48
|
-
assigns(:subject_types).
|
48
|
+
expect(assigns(:subject_types)).to be_empty
|
49
49
|
response.should redirect_to(new_user_session_url)
|
50
50
|
end
|
51
51
|
end
|
@@ -58,7 +58,7 @@ describe SubjectTypesController do
|
|
58
58
|
it "assigns the requested subject_type as @subject_type" do
|
59
59
|
subject_type = FactoryGirl.create(:subject_type)
|
60
60
|
get :show, :id => subject_type.id
|
61
|
-
assigns(:subject_type).
|
61
|
+
expect(assigns(:subject_type)).to eq(subject_type)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -68,7 +68,7 @@ describe SubjectTypesController do
|
|
68
68
|
it "assigns the requested subject_type as @subject_type" do
|
69
69
|
subject_type = FactoryGirl.create(:subject_type)
|
70
70
|
get :show, :id => subject_type.id
|
71
|
-
assigns(:subject_type).
|
71
|
+
expect(assigns(:subject_type)).to eq(subject_type)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -78,7 +78,7 @@ describe SubjectTypesController do
|
|
78
78
|
it "assigns the requested subject_type as @subject_type" do
|
79
79
|
subject_type = FactoryGirl.create(:subject_type)
|
80
80
|
get :show, :id => subject_type.id
|
81
|
-
assigns(:subject_type).
|
81
|
+
expect(assigns(:subject_type)).to eq(subject_type)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -86,7 +86,7 @@ describe SubjectTypesController do
|
|
86
86
|
it "assigns the requested subject_type as @subject_type" do
|
87
87
|
subject_type = FactoryGirl.create(:subject_type)
|
88
88
|
get :show, :id => subject_type.id
|
89
|
-
assigns(:subject_type).
|
89
|
+
expect(assigns(:subject_type)).to eq(subject_type)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -97,7 +97,7 @@ describe SubjectTypesController do
|
|
97
97
|
|
98
98
|
it "assigns the requested subject_type as @subject_type" do
|
99
99
|
get :new
|
100
|
-
assigns(:subject_type).
|
100
|
+
expect(assigns(:subject_type)).not_to be_valid
|
101
101
|
response.should be_success
|
102
102
|
end
|
103
103
|
end
|
@@ -107,7 +107,7 @@ describe SubjectTypesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested subject_type as @subject_type" do
|
109
109
|
get :new
|
110
|
-
assigns(:subject_type).
|
110
|
+
expect(assigns(:subject_type)).not_to be_valid
|
111
111
|
response.should be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -117,7 +117,7 @@ describe SubjectTypesController do
|
|
117
117
|
|
118
118
|
it "should not assign the requested subject_type as @subject_type" do
|
119
119
|
get :new
|
120
|
-
assigns(:subject_type).
|
120
|
+
expect(assigns(:subject_type)).not_to be_valid
|
121
121
|
response.should be_forbidden
|
122
122
|
end
|
123
123
|
end
|
@@ -125,7 +125,7 @@ describe SubjectTypesController do
|
|
125
125
|
describe "When not logged in" do
|
126
126
|
it "should not assign the requested subject_type as @subject_type" do
|
127
127
|
get :new
|
128
|
-
assigns(:subject_type).
|
128
|
+
expect(assigns(:subject_type)).not_to be_valid
|
129
129
|
response.should redirect_to(new_user_session_url)
|
130
130
|
end
|
131
131
|
end
|
@@ -138,7 +138,7 @@ describe SubjectTypesController do
|
|
138
138
|
it "assigns the requested subject_type as @subject_type" do
|
139
139
|
subject_type = FactoryGirl.create(:subject_type)
|
140
140
|
get :edit, :id => subject_type.id
|
141
|
-
assigns(:subject_type).
|
141
|
+
expect(assigns(:subject_type)).to eq(subject_type)
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
@@ -183,7 +183,7 @@ describe SubjectTypesController do
|
|
183
183
|
describe "with valid params" do
|
184
184
|
it "assigns a newly created subject_type as @subject_type" do
|
185
185
|
post :create, :subject_type => @attrs
|
186
|
-
assigns(:subject_type).
|
186
|
+
expect(assigns(:subject_type)).to be_valid
|
187
187
|
end
|
188
188
|
|
189
189
|
it "redirects to the created agent" do
|
@@ -195,7 +195,7 @@ describe SubjectTypesController do
|
|
195
195
|
describe "with invalid params" do
|
196
196
|
it "assigns a newly created but unsaved subject_type as @subject_type" do
|
197
197
|
post :create, :subject_type => @invalid_attrs
|
198
|
-
assigns(:subject_type).
|
198
|
+
expect(assigns(:subject_type)).not_to be_valid
|
199
199
|
end
|
200
200
|
|
201
201
|
it "should be successful" do
|
@@ -211,7 +211,7 @@ describe SubjectTypesController do
|
|
211
211
|
describe "with valid params" do
|
212
212
|
it "assigns a newly created subject_type as @subject_type" do
|
213
213
|
post :create, :subject_type => @attrs
|
214
|
-
assigns(:subject_type).
|
214
|
+
expect(assigns(:subject_type)).to be_valid
|
215
215
|
end
|
216
216
|
|
217
217
|
it "should be forbidden" do
|
@@ -223,7 +223,7 @@ describe SubjectTypesController do
|
|
223
223
|
describe "with invalid params" do
|
224
224
|
it "assigns a newly created but unsaved subject_type as @subject_type" do
|
225
225
|
post :create, :subject_type => @invalid_attrs
|
226
|
-
assigns(:subject_type).
|
226
|
+
expect(assigns(:subject_type)).not_to be_valid
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should be forbidden" do
|
@@ -239,7 +239,7 @@ describe SubjectTypesController do
|
|
239
239
|
describe "with valid params" do
|
240
240
|
it "assigns a newly created subject_type as @subject_type" do
|
241
241
|
post :create, :subject_type => @attrs
|
242
|
-
assigns(:subject_type).
|
242
|
+
expect(assigns(:subject_type)).to be_valid
|
243
243
|
end
|
244
244
|
|
245
245
|
it "should be forbidden" do
|
@@ -251,7 +251,7 @@ describe SubjectTypesController do
|
|
251
251
|
describe "with invalid params" do
|
252
252
|
it "assigns a newly created but unsaved subject_type as @subject_type" do
|
253
253
|
post :create, :subject_type => @invalid_attrs
|
254
|
-
assigns(:subject_type).
|
254
|
+
expect(assigns(:subject_type)).not_to be_valid
|
255
255
|
end
|
256
256
|
|
257
257
|
it "should be forbidden" do
|
@@ -265,7 +265,7 @@ describe SubjectTypesController do
|
|
265
265
|
describe "with valid params" do
|
266
266
|
it "assigns a newly created subject_type as @subject_type" do
|
267
267
|
post :create, :subject_type => @attrs
|
268
|
-
assigns(:subject_type).
|
268
|
+
expect(assigns(:subject_type)).to be_valid
|
269
269
|
end
|
270
270
|
|
271
271
|
it "should be forbidden" do
|
@@ -277,7 +277,7 @@ describe SubjectTypesController do
|
|
277
277
|
describe "with invalid params" do
|
278
278
|
it "assigns a newly created but unsaved subject_type as @subject_type" do
|
279
279
|
post :create, :subject_type => @invalid_attrs
|
280
|
-
assigns(:subject_type).
|
280
|
+
expect(assigns(:subject_type)).not_to be_valid
|
281
281
|
end
|
282
282
|
|
283
283
|
it "should be forbidden" do
|
@@ -305,7 +305,7 @@ describe SubjectTypesController do
|
|
305
305
|
|
306
306
|
it "assigns the requested subject_type as @subject_type" do
|
307
307
|
put :update, :id => @subject_type.id, :subject_type => @attrs
|
308
|
-
assigns(:subject_type).
|
308
|
+
expect(assigns(:subject_type)).to eq(@subject_type)
|
309
309
|
end
|
310
310
|
|
311
311
|
it "moves its position when specified" do
|
@@ -332,7 +332,7 @@ describe SubjectTypesController do
|
|
332
332
|
|
333
333
|
it "assigns the requested subject_type as @subject_type" do
|
334
334
|
put :update, :id => @subject_type.id, :subject_type => @attrs
|
335
|
-
assigns(:subject_type).
|
335
|
+
expect(assigns(:subject_type)).to eq(@subject_type)
|
336
336
|
response.should be_forbidden
|
337
337
|
end
|
338
338
|
end
|
@@ -355,7 +355,7 @@ describe SubjectTypesController do
|
|
355
355
|
|
356
356
|
it "assigns the requested subject_type as @subject_type" do
|
357
357
|
put :update, :id => @subject_type.id, :subject_type => @attrs
|
358
|
-
assigns(:subject_type).
|
358
|
+
expect(assigns(:subject_type)).to eq(@subject_type)
|
359
359
|
response.should be_forbidden
|
360
360
|
end
|
361
361
|
end
|
@@ -17,7 +17,7 @@ describe SubjectsController do
|
|
17
17
|
|
18
18
|
it "assigns all subjects as @subjects" do
|
19
19
|
get :index
|
20
|
-
assigns(:subjects).
|
20
|
+
expect(assigns(:subjects)).not_to be_nil
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,7 +26,7 @@ describe SubjectsController do
|
|
26
26
|
|
27
27
|
it "assigns all subjects as @subjects" do
|
28
28
|
get :index
|
29
|
-
assigns(:subjects).
|
29
|
+
expect(assigns(:subjects)).not_to be_nil
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,7 +35,7 @@ describe SubjectsController do
|
|
35
35
|
|
36
36
|
it "assigns all subjects as @subjects" do
|
37
37
|
get :index
|
38
|
-
assigns(:subjects).
|
38
|
+
expect(assigns(:subjects)).not_to be_nil
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -43,7 +43,7 @@ describe SubjectsController do
|
|
43
43
|
it "assigns all subjects as @subjects" do
|
44
44
|
get :index
|
45
45
|
response.should be_success
|
46
|
-
assigns(:subjects).
|
46
|
+
expect(assigns(:subjects)).not_to be_nil
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -55,7 +55,7 @@ describe SubjectsController do
|
|
55
55
|
it "assigns the requested subject as @subject" do
|
56
56
|
subject = FactoryGirl.create(:subject)
|
57
57
|
get :show, :id => subject.id
|
58
|
-
assigns(:subject).
|
58
|
+
expect(assigns(:subject)).to eq(subject)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -65,7 +65,7 @@ describe SubjectsController do
|
|
65
65
|
it "assigns the requested subject as @subject" do
|
66
66
|
subject = FactoryGirl.create(:subject)
|
67
67
|
get :show, :id => subject.id
|
68
|
-
assigns(:subject).
|
68
|
+
expect(assigns(:subject)).to eq(subject)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
@@ -75,7 +75,7 @@ describe SubjectsController do
|
|
75
75
|
it "assigns the requested subject as @subject" do
|
76
76
|
subject = FactoryGirl.create(:subject)
|
77
77
|
get :show, :id => subject.id
|
78
|
-
assigns(:subject).
|
78
|
+
expect(assigns(:subject)).to eq(subject)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -83,7 +83,7 @@ describe SubjectsController do
|
|
83
83
|
it "assigns the requested subject as @subject" do
|
84
84
|
subject = FactoryGirl.create(:subject)
|
85
85
|
get :show, :id => subject.id
|
86
|
-
assigns(:subject).
|
86
|
+
expect(assigns(:subject)).to eq(subject)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -94,7 +94,7 @@ describe SubjectsController do
|
|
94
94
|
|
95
95
|
it "assigns the requested subject as @subject" do
|
96
96
|
get :new
|
97
|
-
assigns(:subject).
|
97
|
+
expect(assigns(:subject)).not_to be_valid
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -103,7 +103,7 @@ describe SubjectsController do
|
|
103
103
|
|
104
104
|
it "assigns the requested subject as @subject" do
|
105
105
|
get :new
|
106
|
-
assigns(:subject).
|
106
|
+
expect(assigns(:subject)).not_to be_valid
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -112,7 +112,7 @@ describe SubjectsController do
|
|
112
112
|
|
113
113
|
it "should not assign the requested subject as @subject" do
|
114
114
|
get :new
|
115
|
-
assigns(:subject).
|
115
|
+
expect(assigns(:subject)).not_to be_valid
|
116
116
|
response.should be_forbidden
|
117
117
|
end
|
118
118
|
end
|
@@ -120,7 +120,7 @@ describe SubjectsController do
|
|
120
120
|
describe "When not logged in" do
|
121
121
|
it "should not assign the requested subject as @subject" do
|
122
122
|
get :new
|
123
|
-
assigns(:subject).
|
123
|
+
expect(assigns(:subject)).not_to be_valid
|
124
124
|
response.should redirect_to(new_user_session_url)
|
125
125
|
end
|
126
126
|
end
|
@@ -133,7 +133,7 @@ describe SubjectsController do
|
|
133
133
|
it "assigns the requested subject as @subject" do
|
134
134
|
subject = FactoryGirl.create(:subject)
|
135
135
|
get :edit, :id => subject.id
|
136
|
-
assigns(:subject).
|
136
|
+
expect(assigns(:subject)).to eq(subject)
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
@@ -143,7 +143,7 @@ describe SubjectsController do
|
|
143
143
|
it "assigns the requested subject as @subject" do
|
144
144
|
subject = FactoryGirl.create(:subject)
|
145
145
|
get :edit, :id => subject.id
|
146
|
-
assigns(:subject).
|
146
|
+
expect(assigns(:subject)).to eq(subject)
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -178,7 +178,7 @@ describe SubjectsController do
|
|
178
178
|
describe "with valid params" do
|
179
179
|
it "assigns a newly created subject as @subject" do
|
180
180
|
post :create, :subject => @attrs
|
181
|
-
assigns(:subject).
|
181
|
+
expect(assigns(:subject)).to be_valid
|
182
182
|
end
|
183
183
|
|
184
184
|
it "redirects to the created subject" do
|
@@ -190,7 +190,7 @@ describe SubjectsController do
|
|
190
190
|
describe "with invalid params" do
|
191
191
|
it "assigns a newly created but unsaved subject as @subject" do
|
192
192
|
post :create, :subject => @invalid_attrs
|
193
|
-
assigns(:subject).
|
193
|
+
expect(assigns(:subject)).not_to be_valid
|
194
194
|
end
|
195
195
|
|
196
196
|
it "re-renders the 'new' template" do
|
@@ -206,7 +206,7 @@ describe SubjectsController do
|
|
206
206
|
describe "with valid params" do
|
207
207
|
it "assigns a newly created subject as @subject" do
|
208
208
|
post :create, :subject => @attrs
|
209
|
-
assigns(:subject).
|
209
|
+
expect(assigns(:subject)).to be_valid
|
210
210
|
end
|
211
211
|
|
212
212
|
it "should be forbidden" do
|
@@ -218,7 +218,7 @@ describe SubjectsController do
|
|
218
218
|
describe "with invalid params" do
|
219
219
|
it "assigns a newly created but unsaved subject as @subject" do
|
220
220
|
post :create, :subject => @invalid_attrs
|
221
|
-
assigns(:subject).
|
221
|
+
expect(assigns(:subject)).not_to be_valid
|
222
222
|
end
|
223
223
|
|
224
224
|
it "should be forbidden" do
|
@@ -234,7 +234,7 @@ describe SubjectsController do
|
|
234
234
|
describe "with valid params" do
|
235
235
|
it "assigns a newly created subject as @subject" do
|
236
236
|
post :create, :subject => @attrs
|
237
|
-
assigns(:subject).
|
237
|
+
expect(assigns(:subject)).to be_valid
|
238
238
|
end
|
239
239
|
|
240
240
|
it "should be forbidden" do
|
@@ -246,7 +246,7 @@ describe SubjectsController do
|
|
246
246
|
describe "with invalid params" do
|
247
247
|
it "assigns a newly created but unsaved subject as @subject" do
|
248
248
|
post :create, :subject => @invalid_attrs
|
249
|
-
assigns(:subject).
|
249
|
+
expect(assigns(:subject)).not_to be_valid
|
250
250
|
end
|
251
251
|
|
252
252
|
it "should be forbidden" do
|
@@ -260,7 +260,7 @@ describe SubjectsController do
|
|
260
260
|
describe "with valid params" do
|
261
261
|
it "assigns a newly created subject as @subject" do
|
262
262
|
post :create, :subject => @attrs
|
263
|
-
assigns(:subject).
|
263
|
+
expect(assigns(:subject)).to be_valid
|
264
264
|
end
|
265
265
|
|
266
266
|
it "should be forbidden" do
|
@@ -272,7 +272,7 @@ describe SubjectsController do
|
|
272
272
|
describe "with invalid params" do
|
273
273
|
it "assigns a newly created but unsaved subject as @subject" do
|
274
274
|
post :create, :subject => @invalid_attrs
|
275
|
-
assigns(:subject).
|
275
|
+
expect(assigns(:subject)).not_to be_valid
|
276
276
|
end
|
277
277
|
|
278
278
|
it "should be forbidden" do
|
@@ -300,7 +300,7 @@ describe SubjectsController do
|
|
300
300
|
|
301
301
|
it "assigns the requested subject as @subject" do
|
302
302
|
put :update, :id => @subject.id, :subject => @attrs
|
303
|
-
assigns(:subject).
|
303
|
+
expect(assigns(:subject)).to eq(@subject)
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
@@ -322,7 +322,7 @@ describe SubjectsController do
|
|
322
322
|
|
323
323
|
it "should be forbidden" do
|
324
324
|
put :update, :id => @subject.id, :subject => @attrs
|
325
|
-
assigns(:subject).
|
325
|
+
expect(assigns(:subject)).to eq(@subject)
|
326
326
|
response.should be_forbidden
|
327
327
|
end
|
328
328
|
end
|
@@ -345,7 +345,7 @@ describe SubjectsController do
|
|
345
345
|
|
346
346
|
it "assigns the requested subject as @subject" do
|
347
347
|
put :update, :id => @subject.id, :subject => @attrs
|
348
|
-
assigns(:subject).
|
348
|
+
expect(assigns(:subject)).to eq(@subject)
|
349
349
|
response.should be_forbidden
|
350
350
|
end
|
351
351
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|