enju_biblio 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/assets/images/icons/book.png +0 -0
- data/app/assets/images/icons/cd.png +0 -0
- data/app/assets/images/icons/dvd.png +0 -0
- data/app/assets/images/icons/monitor.png +0 -0
- data/app/controllers/carrier_types_controller.rb +8 -3
- data/app/controllers/manifestations_controller.rb +17 -4
- data/app/controllers/picture_files_controller.rb +1 -1
- data/app/controllers/series_statements_controller.rb +6 -0
- data/app/helpers/manifestations_helper.rb +1 -1
- data/app/models/agent_import_file_transition.rb +1 -0
- data/app/models/carrier_type.rb +11 -7
- data/app/models/import_request_transition.rb +1 -0
- data/app/models/manifestation.rb +5 -0
- data/app/models/resource_export_file_transition.rb +1 -0
- data/app/models/resource_import_file_transition.rb +1 -0
- data/app/views/carrier_types/index.html.erb +4 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +4 -0
- data/app/views/manifestations/index.html.erb +3 -0
- data/config/locales/translation_en.yml +2 -0
- data/config/locales/translation_ja.yml +2 -0
- data/lib/enju_biblio/biblio_helper.rb +1 -12
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/config/schedule.rb +3 -3
- data/lib/tasks/carrier_type.rb +30 -18
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +87 -87
- data/spec/controllers/agent_import_results_controller_spec.rb +22 -22
- data/spec/controllers/agent_merge_lists_controller_spec.rb +157 -157
- data/spec/controllers/agent_merges_controller_spec.rb +151 -151
- data/spec/controllers/agent_relationship_types_controller_spec.rb +152 -152
- data/spec/controllers/agent_relationships_controller_spec.rb +153 -153
- data/spec/controllers/agent_types_controller_spec.rb +49 -50
- data/spec/controllers/agents_controller_spec.rb +234 -234
- data/spec/controllers/carrier_types_controller_spec.rb +123 -103
- data/spec/controllers/content_types_controller_spec.rb +51 -52
- data/spec/controllers/countries_controller_spec.rb +156 -156
- data/spec/controllers/create_types_controller_spec.rb +48 -49
- data/spec/controllers/creates_controller_spec.rb +154 -154
- data/spec/controllers/donates_controller_spec.rb +153 -153
- data/spec/controllers/form_of_works_controller_spec.rb +48 -49
- data/spec/controllers/frequencies_controller_spec.rb +51 -52
- data/spec/controllers/identifier_types_controller_spec.rb +48 -49
- data/spec/controllers/import_requests_controller_spec.rb +165 -164
- data/spec/controllers/items_controller_spec.rb +214 -216
- data/spec/controllers/languages_controller_spec.rb +109 -109
- data/spec/controllers/licenses_controller_spec.rb +48 -49
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +152 -152
- data/spec/controllers/manifestation_relationships_controller_spec.rb +153 -153
- data/spec/controllers/manifestations_controller_spec.rb +319 -289
- data/spec/controllers/medium_of_performances_controller_spec.rb +48 -49
- data/spec/controllers/owns_controller_spec.rb +153 -153
- data/spec/controllers/picture_files_controller_spec.rb +156 -156
- data/spec/controllers/produce_types_controller_spec.rb +48 -49
- data/spec/controllers/produces_controller_spec.rb +154 -154
- data/spec/controllers/realize_types_controller_spec.rb +48 -49
- data/spec/controllers/realizes_controller_spec.rb +155 -155
- data/spec/controllers/resource_export_files_controller_spec.rb +72 -72
- data/spec/controllers/resource_import_files_controller_spec.rb +90 -90
- data/spec/controllers/resource_import_results_controller_spec.rb +43 -43
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +153 -153
- data/spec/controllers/series_statement_merges_controller_spec.rb +151 -151
- data/spec/controllers/series_statements_controller_spec.rb +154 -154
- data/spec/factories/checkout.rb +9 -0
- data/spec/factories/library.rb +13 -0
- data/spec/factories/shelf.rb +6 -0
- data/spec/fixtures/carrier_types.yml +11 -7
- data/spec/models/carrier_type_spec.rb +11 -7
- data/spec/models/resource_export_file_spec.rb +58 -16
- data/spec/support/resque.rb +0 -1
- data/spec/views/manifestations/show.html.erb_spec.rb +5 -0
- data/spec/views/resource_import_files/index.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_files/show.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_results/index.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
- metadata +49 -39
@@ -9,119 +9,119 @@ describe ManifestationRelationshipsController do
|
|
9
9
|
@attrs = FactoryGirl.attributes_for(:manifestation_relationship)
|
10
10
|
end
|
11
11
|
|
12
|
-
describe
|
12
|
+
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
14
|
FactoryGirl.create(:manifestation_relationship)
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
17
|
+
describe 'When logged in as Administrator' do
|
18
18
|
login_fixture_admin
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'assigns all manifestation_relationships as @manifestation_relationships' do
|
21
21
|
get :index
|
22
22
|
expect(assigns(:manifestation_relationships)).to eq(ManifestationRelationship.page(1))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
describe
|
26
|
+
describe 'When logged in as Librarian' do
|
27
27
|
login_fixture_librarian
|
28
28
|
|
29
|
-
it
|
29
|
+
it 'assigns all manifestation_relationships as @manifestation_relationships' do
|
30
30
|
get :index
|
31
31
|
expect(assigns(:manifestation_relationships)).to eq(ManifestationRelationship.page(1))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe
|
35
|
+
describe 'When logged in as User' do
|
36
36
|
login_fixture_user
|
37
37
|
|
38
|
-
it
|
38
|
+
it 'assigns all manifestation_relationships as @manifestation_relationships' do
|
39
39
|
get :index
|
40
40
|
expect(assigns(:manifestation_relationships)).to eq(ManifestationRelationship.page(1))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe
|
45
|
-
it
|
44
|
+
describe 'When not logged in' do
|
45
|
+
it 'assigns all manifestation_relationships as @manifestation_relationships' do
|
46
46
|
get :index
|
47
47
|
expect(assigns(:manifestation_relationships)).to eq(ManifestationRelationship.page(1))
|
48
48
|
end
|
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 manifestation_relationship as @manifestation_relationship' do
|
57
57
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
58
|
-
get :show, :
|
58
|
+
get :show, id: manifestation_relationship.id
|
59
59
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
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 manifestation_relationship as @manifestation_relationship' do
|
67
67
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
68
|
-
get :show, :
|
68
|
+
get :show, id: manifestation_relationship.id
|
69
69
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
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 manifestation_relationship as @manifestation_relationship' do
|
77
77
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
78
|
-
get :show, :
|
78
|
+
get :show, id: manifestation_relationship.id
|
79
79
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
84
|
-
it
|
83
|
+
describe 'When not logged in' do
|
84
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
85
85
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
86
|
-
get :show, :
|
86
|
+
get :show, id: manifestation_relationship.id
|
87
87
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
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 manifestation_relationship as @manifestation_relationship' do
|
97
97
|
get :new
|
98
98
|
expect(assigns(:manifestation_relationship)).to be_nil
|
99
99
|
expect(response).to redirect_to manifestations_url
|
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 'should not assign the requested manifestation_relationship as @manifestation_relationship' do
|
107
107
|
get :new
|
108
108
|
expect(assigns(:manifestation_relationship)).to be_nil
|
109
109
|
expect(response).to redirect_to manifestations_url
|
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 manifestation_relationship as @manifestation_relationship' do
|
117
117
|
get :new
|
118
118
|
expect(assigns(:manifestation_relationship)).to be_nil
|
119
119
|
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
125
125
|
get :new
|
126
126
|
expect(assigns(:manifestation_relationship)).to be_nil
|
127
127
|
expect(response).to redirect_to(new_user_session_url)
|
@@ -129,316 +129,316 @@ describe ManifestationRelationshipsController 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 manifestation_relationship as @manifestation_relationship' do
|
137
137
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
138
|
-
get :edit, :
|
138
|
+
get :edit, id: manifestation_relationship.id
|
139
139
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
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 manifestation_relationship as @manifestation_relationship' do
|
147
147
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
148
|
-
get :edit, :
|
148
|
+
get :edit, id: manifestation_relationship.id
|
149
149
|
expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
|
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 manifestation_relationship as @manifestation_relationship' do
|
157
157
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
158
|
-
get :edit, :
|
158
|
+
get :edit, id: manifestation_relationship.id
|
159
159
|
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
165
165
|
manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
166
|
-
get :edit, :
|
166
|
+
get :edit, id: manifestation_relationship.id
|
167
167
|
expect(response).to 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 = { parent_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 manifestation_relationship as @manifestation_relationship' do
|
183
|
+
post :create, manifestation_relationship: @attrs
|
184
184
|
expect(assigns(:manifestation_relationship)).to be_valid
|
185
185
|
end
|
186
186
|
|
187
|
-
it
|
188
|
-
post :create, :
|
187
|
+
it 'redirects to the created manifestation' do
|
188
|
+
post :create, manifestation_relationship: @attrs
|
189
189
|
expect(response).to redirect_to(assigns(:manifestation_relationship))
|
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 manifestation_relationship as @manifestation_relationship' do
|
195
|
+
post :create, manifestation_relationship: @invalid_attrs
|
196
196
|
expect(assigns(:manifestation_relationship)).not_to be_valid
|
197
197
|
end
|
198
198
|
|
199
199
|
it "re-renders the 'new' template" do
|
200
|
-
post :create, :
|
201
|
-
expect(response).to render_template(
|
200
|
+
post :create, manifestation_relationship: @invalid_attrs
|
201
|
+
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
211
|
+
post :create, manifestation_relationship: @attrs
|
212
212
|
expect(assigns(:manifestation_relationship)).to be_valid
|
213
213
|
end
|
214
214
|
|
215
|
-
it
|
216
|
-
post :create, :
|
215
|
+
it 'redirects to the created manifestation' do
|
216
|
+
post :create, manifestation_relationship: @attrs
|
217
217
|
expect(response).to redirect_to(assigns(:manifestation_relationship))
|
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 manifestation_relationship as @manifestation_relationship' do
|
223
|
+
post :create, manifestation_relationship: @invalid_attrs
|
224
224
|
expect(assigns(:manifestation_relationship)).not_to be_valid
|
225
225
|
end
|
226
226
|
|
227
227
|
it "re-renders the 'new' template" do
|
228
|
-
post :create, :
|
229
|
-
expect(response).to render_template(
|
228
|
+
post :create, manifestation_relationship: @invalid_attrs
|
229
|
+
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
239
|
+
post :create, manifestation_relationship: @attrs
|
240
240
|
expect(assigns(:manifestation_relationship)).to be_nil
|
241
241
|
end
|
242
242
|
|
243
|
-
it
|
244
|
-
post :create, :
|
243
|
+
it 'should be forbidden' do
|
244
|
+
post :create, manifestation_relationship: @attrs
|
245
245
|
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
251
|
+
post :create, manifestation_relationship: @invalid_attrs
|
252
252
|
expect(assigns(:manifestation_relationship)).to be_nil
|
253
253
|
end
|
254
254
|
|
255
|
-
it
|
256
|
-
post :create, :
|
255
|
+
it 'should be forbidden' do
|
256
|
+
post :create, manifestation_relationship: @invalid_attrs
|
257
257
|
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
265
|
+
post :create, manifestation_relationship: @attrs
|
266
266
|
expect(assigns(:manifestation_relationship)).to be_nil
|
267
267
|
end
|
268
268
|
|
269
|
-
it
|
270
|
-
post :create, :
|
269
|
+
it 'should be forbidden' do
|
270
|
+
post :create, manifestation_relationship: @attrs
|
271
271
|
expect(response).to 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 manifestation_relationship as @manifestation_relationship' do
|
277
|
+
post :create, manifestation_relationship: @invalid_attrs
|
278
278
|
expect(assigns(:manifestation_relationship)).to be_nil
|
279
279
|
end
|
280
280
|
|
281
|
-
it
|
282
|
-
post :create, :
|
281
|
+
it 'should be forbidden' do
|
282
|
+
post :create, manifestation_relationship: @invalid_attrs
|
283
283
|
expect(response).to 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
|
@manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
292
292
|
@attrs = valid_attributes
|
293
|
-
@invalid_attrs = {:
|
293
|
+
@invalid_attrs = { parent_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 manifestation_relationship' do
|
301
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
302
302
|
end
|
303
303
|
|
304
|
-
it
|
305
|
-
put :update, :
|
304
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
305
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
306
306
|
expect(assigns(:manifestation_relationship)).to eq(@manifestation_relationship)
|
307
307
|
expect(response).to redirect_to(@manifestation_relationship)
|
308
308
|
end
|
309
309
|
|
310
|
-
it
|
311
|
-
put :update, :
|
310
|
+
it 'moves its position when specified' do
|
311
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs, move: 'lower', manifestation_id: @manifestation_relationship.parent.id
|
312
312
|
expect(response).to redirect_to(manifestation_relationships_url(manifestation_id: @manifestation_relationship.parent_id))
|
313
313
|
end
|
314
314
|
end
|
315
315
|
|
316
|
-
describe
|
317
|
-
it
|
318
|
-
put :update, :
|
319
|
-
expect(response).to render_template(
|
316
|
+
describe 'with invalid params' do
|
317
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
318
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @invalid_attrs
|
319
|
+
expect(response).to render_template('edit')
|
320
320
|
end
|
321
321
|
end
|
322
322
|
end
|
323
323
|
|
324
|
-
describe
|
324
|
+
describe 'When logged in as Librarian' do
|
325
325
|
login_fixture_librarian
|
326
326
|
|
327
|
-
describe
|
328
|
-
it
|
329
|
-
put :update, :
|
327
|
+
describe 'with valid params' do
|
328
|
+
it 'updates the requested manifestation_relationship' do
|
329
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
330
330
|
end
|
331
331
|
|
332
|
-
it
|
333
|
-
put :update, :
|
332
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
333
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
334
334
|
expect(assigns(:manifestation_relationship)).to eq(@manifestation_relationship)
|
335
335
|
expect(response).to redirect_to(@manifestation_relationship)
|
336
336
|
end
|
337
337
|
end
|
338
338
|
|
339
|
-
describe
|
340
|
-
it
|
341
|
-
put :update, :
|
342
|
-
expect(response).to render_template(
|
339
|
+
describe 'with invalid params' do
|
340
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
341
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @invalid_attrs
|
342
|
+
expect(response).to render_template('edit')
|
343
343
|
end
|
344
344
|
end
|
345
345
|
end
|
346
346
|
|
347
|
-
describe
|
347
|
+
describe 'When logged in as User' do
|
348
348
|
login_fixture_user
|
349
349
|
|
350
|
-
describe
|
351
|
-
it
|
352
|
-
put :update, :
|
350
|
+
describe 'with valid params' do
|
351
|
+
it 'updates the requested manifestation_relationship' do
|
352
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
353
353
|
end
|
354
354
|
|
355
|
-
it
|
356
|
-
put :update, :
|
355
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
356
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
357
357
|
expect(assigns(:manifestation_relationship)).to eq(@manifestation_relationship)
|
358
358
|
expect(response).to be_forbidden
|
359
359
|
end
|
360
360
|
end
|
361
361
|
|
362
|
-
describe
|
363
|
-
it
|
364
|
-
put :update, :
|
362
|
+
describe 'with invalid params' do
|
363
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
364
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @invalid_attrs
|
365
365
|
expect(response).to be_forbidden
|
366
366
|
end
|
367
367
|
end
|
368
368
|
end
|
369
369
|
|
370
|
-
describe
|
371
|
-
describe
|
372
|
-
it
|
373
|
-
put :update, :
|
370
|
+
describe 'When not logged in' do
|
371
|
+
describe 'with valid params' do
|
372
|
+
it 'updates the requested manifestation_relationship' do
|
373
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
374
374
|
end
|
375
375
|
|
376
|
-
it
|
377
|
-
put :update, :
|
376
|
+
it 'should be forbidden' do
|
377
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @attrs
|
378
378
|
expect(response).to redirect_to(new_user_session_url)
|
379
379
|
end
|
380
380
|
end
|
381
381
|
|
382
|
-
describe
|
383
|
-
it
|
384
|
-
put :update, :
|
382
|
+
describe 'with invalid params' do
|
383
|
+
it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
|
384
|
+
put :update, id: @manifestation_relationship.id, manifestation_relationship: @invalid_attrs
|
385
385
|
expect(response).to redirect_to(new_user_session_url)
|
386
386
|
end
|
387
387
|
end
|
388
388
|
end
|
389
389
|
end
|
390
390
|
|
391
|
-
describe
|
391
|
+
describe 'DELETE destroy' do
|
392
392
|
before(:each) do
|
393
393
|
@manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
|
394
394
|
end
|
395
395
|
|
396
|
-
describe
|
396
|
+
describe 'When logged in as Administrator' do
|
397
397
|
login_fixture_admin
|
398
398
|
|
399
|
-
it
|
400
|
-
delete :destroy, :
|
399
|
+
it 'destroys the requested manifestation_relationship' do
|
400
|
+
delete :destroy, id: @manifestation_relationship.id
|
401
401
|
end
|
402
402
|
|
403
|
-
it
|
404
|
-
delete :destroy, :
|
403
|
+
it 'redirects to the manifestation_relationships list' do
|
404
|
+
delete :destroy, id: @manifestation_relationship.id
|
405
405
|
expect(response).to redirect_to(manifestation_relationships_url)
|
406
406
|
end
|
407
407
|
end
|
408
408
|
|
409
|
-
describe
|
409
|
+
describe 'When logged in as Librarian' do
|
410
410
|
login_fixture_librarian
|
411
411
|
|
412
|
-
it
|
413
|
-
delete :destroy, :
|
412
|
+
it 'destroys the requested manifestation_relationship' do
|
413
|
+
delete :destroy, id: @manifestation_relationship.id
|
414
414
|
end
|
415
415
|
|
416
|
-
it
|
417
|
-
delete :destroy, :
|
416
|
+
it 'redirects to the manifestation_relationships list' do
|
417
|
+
delete :destroy, id: @manifestation_relationship.id
|
418
418
|
expect(response).to redirect_to(manifestation_relationships_url)
|
419
419
|
end
|
420
420
|
end
|
421
421
|
|
422
|
-
describe
|
422
|
+
describe 'When logged in as User' do
|
423
423
|
login_fixture_user
|
424
424
|
|
425
|
-
it
|
426
|
-
delete :destroy, :
|
425
|
+
it 'destroys the requested manifestation_relationship' do
|
426
|
+
delete :destroy, id: @manifestation_relationship.id
|
427
427
|
end
|
428
428
|
|
429
|
-
it
|
430
|
-
delete :destroy, :
|
429
|
+
it 'should be forbidden' do
|
430
|
+
delete :destroy, id: @manifestation_relationship.id
|
431
431
|
expect(response).to be_forbidden
|
432
432
|
end
|
433
433
|
end
|
434
434
|
|
435
|
-
describe
|
436
|
-
it
|
437
|
-
delete :destroy, :
|
435
|
+
describe 'When not logged in' do
|
436
|
+
it 'destroys the requested manifestation_relationship' do
|
437
|
+
delete :destroy, id: @manifestation_relationship.id
|
438
438
|
end
|
439
439
|
|
440
|
-
it
|
441
|
-
delete :destroy, :
|
440
|
+
it 'should be forbidden' do
|
441
|
+
delete :destroy, id: @manifestation_relationship.id
|
442
442
|
expect(response).to redirect_to(new_user_session_url)
|
443
443
|
end
|
444
444
|
end
|