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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/icons/book.png +0 -0
  3. data/app/assets/images/icons/cd.png +0 -0
  4. data/app/assets/images/icons/dvd.png +0 -0
  5. data/app/assets/images/icons/monitor.png +0 -0
  6. data/app/controllers/carrier_types_controller.rb +8 -3
  7. data/app/controllers/manifestations_controller.rb +17 -4
  8. data/app/controllers/picture_files_controller.rb +1 -1
  9. data/app/controllers/series_statements_controller.rb +6 -0
  10. data/app/helpers/manifestations_helper.rb +1 -1
  11. data/app/models/agent_import_file_transition.rb +1 -0
  12. data/app/models/carrier_type.rb +11 -7
  13. data/app/models/import_request_transition.rb +1 -0
  14. data/app/models/manifestation.rb +5 -0
  15. data/app/models/resource_export_file_transition.rb +1 -0
  16. data/app/models/resource_import_file_transition.rb +1 -0
  17. data/app/views/carrier_types/index.html.erb +4 -1
  18. data/app/views/manifestations/_show_detail_librarian.html.erb +4 -0
  19. data/app/views/manifestations/index.html.erb +3 -0
  20. data/config/locales/translation_en.yml +2 -0
  21. data/config/locales/translation_ja.yml +2 -0
  22. data/lib/enju_biblio/biblio_helper.rb +1 -12
  23. data/lib/enju_biblio/version.rb +1 -1
  24. data/lib/generators/enju_biblio/setup/templates/config/schedule.rb +3 -3
  25. data/lib/tasks/carrier_type.rb +30 -18
  26. data/lib/tasks/enju_biblio_tasks.rake +2 -0
  27. data/spec/controllers/agent_import_files_controller_spec.rb +87 -87
  28. data/spec/controllers/agent_import_results_controller_spec.rb +22 -22
  29. data/spec/controllers/agent_merge_lists_controller_spec.rb +157 -157
  30. data/spec/controllers/agent_merges_controller_spec.rb +151 -151
  31. data/spec/controllers/agent_relationship_types_controller_spec.rb +152 -152
  32. data/spec/controllers/agent_relationships_controller_spec.rb +153 -153
  33. data/spec/controllers/agent_types_controller_spec.rb +49 -50
  34. data/spec/controllers/agents_controller_spec.rb +234 -234
  35. data/spec/controllers/carrier_types_controller_spec.rb +123 -103
  36. data/spec/controllers/content_types_controller_spec.rb +51 -52
  37. data/spec/controllers/countries_controller_spec.rb +156 -156
  38. data/spec/controllers/create_types_controller_spec.rb +48 -49
  39. data/spec/controllers/creates_controller_spec.rb +154 -154
  40. data/spec/controllers/donates_controller_spec.rb +153 -153
  41. data/spec/controllers/form_of_works_controller_spec.rb +48 -49
  42. data/spec/controllers/frequencies_controller_spec.rb +51 -52
  43. data/spec/controllers/identifier_types_controller_spec.rb +48 -49
  44. data/spec/controllers/import_requests_controller_spec.rb +165 -164
  45. data/spec/controllers/items_controller_spec.rb +214 -216
  46. data/spec/controllers/languages_controller_spec.rb +109 -109
  47. data/spec/controllers/licenses_controller_spec.rb +48 -49
  48. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +152 -152
  49. data/spec/controllers/manifestation_relationships_controller_spec.rb +153 -153
  50. data/spec/controllers/manifestations_controller_spec.rb +319 -289
  51. data/spec/controllers/medium_of_performances_controller_spec.rb +48 -49
  52. data/spec/controllers/owns_controller_spec.rb +153 -153
  53. data/spec/controllers/picture_files_controller_spec.rb +156 -156
  54. data/spec/controllers/produce_types_controller_spec.rb +48 -49
  55. data/spec/controllers/produces_controller_spec.rb +154 -154
  56. data/spec/controllers/realize_types_controller_spec.rb +48 -49
  57. data/spec/controllers/realizes_controller_spec.rb +155 -155
  58. data/spec/controllers/resource_export_files_controller_spec.rb +72 -72
  59. data/spec/controllers/resource_import_files_controller_spec.rb +90 -90
  60. data/spec/controllers/resource_import_results_controller_spec.rb +43 -43
  61. data/spec/controllers/series_statement_merge_lists_controller_spec.rb +153 -153
  62. data/spec/controllers/series_statement_merges_controller_spec.rb +151 -151
  63. data/spec/controllers/series_statements_controller_spec.rb +154 -154
  64. data/spec/factories/checkout.rb +9 -0
  65. data/spec/factories/library.rb +13 -0
  66. data/spec/factories/shelf.rb +6 -0
  67. data/spec/fixtures/carrier_types.yml +11 -7
  68. data/spec/models/carrier_type_spec.rb +11 -7
  69. data/spec/models/resource_export_file_spec.rb +58 -16
  70. data/spec/support/resque.rb +0 -1
  71. data/spec/views/manifestations/show.html.erb_spec.rb +5 -0
  72. data/spec/views/resource_import_files/index.html.erb_spec.rb +1 -1
  73. data/spec/views/resource_import_files/show.html.erb_spec.rb +1 -1
  74. data/spec/views/resource_import_results/index.html.erb_spec.rb +1 -1
  75. data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
  76. metadata +49 -39
@@ -5,115 +5,115 @@ describe PictureFilesController do
5
5
  fixtures :all
6
6
  disconnect_sunspot
7
7
 
8
- describe "GET index" do
9
- describe "When logged in as Administrator" do
8
+ describe 'GET index' do
9
+ describe 'When logged in as Administrator' do
10
10
  login_fixture_admin
11
11
 
12
- it "assigns all picture_files as @picture_files" do
12
+ it 'assigns all picture_files as @picture_files' do
13
13
  get :index
14
14
  expect(assigns(:picture_files)).to eq(PictureFile.attached.page(1))
15
15
  end
16
16
  end
17
17
 
18
- describe "When logged in as Librarian" do
18
+ describe 'When logged in as Librarian' do
19
19
  login_fixture_librarian
20
20
 
21
- it "assigns all picture_files as @picture_files" do
21
+ it 'assigns all picture_files as @picture_files' do
22
22
  get :index
23
23
  expect(assigns(:picture_files)).to eq(PictureFile.attached.page(1))
24
24
  end
25
25
  end
26
26
 
27
- describe "When logged in as User" do
27
+ describe 'When logged in as User' do
28
28
  login_fixture_user
29
29
 
30
- it "assigns all picture_files as @picture_files" do
30
+ it 'assigns all picture_files as @picture_files' do
31
31
  get :index
32
32
  expect(assigns(:picture_files)).to eq(PictureFile.attached.page(1))
33
33
  end
34
34
  end
35
35
 
36
- describe "When not logged in" do
37
- it "assigns all picture_files as @picture_files" do
36
+ describe 'When not logged in' do
37
+ it 'assigns all picture_files as @picture_files' do
38
38
  get :index
39
39
  expect(assigns(:picture_files)).to eq(PictureFile.attached.page(1))
40
40
  end
41
41
  end
42
42
  end
43
43
 
44
- describe "GET show" do
45
- describe "When logged in as Administrator" do
44
+ describe 'GET show' do
45
+ describe 'When logged in as Administrator' do
46
46
  login_fixture_admin
47
47
 
48
- it "assigns the requested picture_file as @picture_file" do
48
+ it 'assigns the requested picture_file as @picture_file' do
49
49
  picture_file = PictureFile.find(1)
50
- get :show, :id => picture_file.id
50
+ get :show, id: picture_file.id
51
51
  expect(assigns(:picture_file)).to eq(picture_file)
52
52
  end
53
53
  end
54
54
 
55
- describe "When logged in as Librarian" do
55
+ describe 'When logged in as Librarian' do
56
56
  login_fixture_librarian
57
57
 
58
- it "assigns the requested picture_file as @picture_file" do
58
+ it 'assigns the requested picture_file as @picture_file' do
59
59
  picture_file = PictureFile.find(1)
60
- get :show, :id => picture_file.id
60
+ get :show, id: picture_file.id
61
61
  expect(assigns(:picture_file)).to eq(picture_file)
62
62
  end
63
63
  end
64
64
 
65
- describe "When logged in as User" do
65
+ describe 'When logged in as User' do
66
66
  login_fixture_user
67
67
 
68
- it "assigns the requested picture_file as @picture_file" do
68
+ it 'assigns the requested picture_file as @picture_file' do
69
69
  picture_file = PictureFile.find(1)
70
- get :show, :id => picture_file.id
70
+ get :show, id: picture_file.id
71
71
  expect(assigns(:picture_file)).to eq(picture_file)
72
72
  end
73
73
  end
74
74
 
75
- describe "When not logged in" do
76
- it "assigns the requested picture_file as @picture_file" do
75
+ describe 'When not logged in' do
76
+ it 'assigns the requested picture_file as @picture_file' do
77
77
  picture_file = PictureFile.find(1)
78
- get :show, :id => picture_file.id
78
+ get :show, id: picture_file.id
79
79
  expect(assigns(:picture_file)).to eq(picture_file)
80
80
  end
81
81
  end
82
82
  end
83
83
 
84
- describe "GET new" do
85
- describe "When logged in as Administrator" do
84
+ describe 'GET new' do
85
+ describe 'When logged in as Administrator' do
86
86
  login_fixture_admin
87
87
 
88
- it "assigns the requested picture_file as @picture_file" do
88
+ it 'assigns the requested picture_file as @picture_file' do
89
89
  get :new
90
90
  expect(assigns(:picture_file)).to be_nil
91
91
  expect(response).to redirect_to picture_files_url
92
92
  end
93
93
  end
94
94
 
95
- describe "When logged in as Librarian" do
95
+ describe 'When logged in as Librarian' do
96
96
  login_fixture_librarian
97
97
 
98
- it "assigns the requested picture_file as @picture_file" do
98
+ it 'assigns the requested picture_file as @picture_file' do
99
99
  get :new
100
100
  expect(assigns(:picture_file)).to be_nil
101
101
  expect(response).to redirect_to picture_files_url
102
102
  end
103
103
  end
104
104
 
105
- describe "When logged in as User" do
105
+ describe 'When logged in as User' do
106
106
  login_fixture_user
107
107
 
108
- it "should not assign the requested picture_file as @picture_file" do
108
+ it 'should not assign the requested picture_file as @picture_file' do
109
109
  get :new
110
110
  expect(assigns(:picture_file)).to be_nil
111
111
  expect(response).to be_forbidden
112
112
  end
113
113
  end
114
114
 
115
- describe "When not logged in" do
116
- it "should not assign the requested picture_file as @picture_file" do
115
+ describe 'When not logged in' do
116
+ it 'should not assign the requested picture_file as @picture_file' do
117
117
  get :new
118
118
  expect(assigns(:picture_file)).to be_nil
119
119
  expect(response).to redirect_to(new_user_session_url)
@@ -121,320 +121,320 @@ describe PictureFilesController do
121
121
  end
122
122
  end
123
123
 
124
- describe "GET edit" do
125
- describe "When logged in as Administrator" do
124
+ describe 'GET edit' do
125
+ describe 'When logged in as Administrator' do
126
126
  login_fixture_admin
127
127
 
128
- it "assigns the requested picture_file as @picture_file" do
128
+ it 'assigns the requested picture_file as @picture_file' do
129
129
  picture_file = PictureFile.find(1)
130
- get :edit, :id => picture_file.id
130
+ get :edit, id: picture_file.id
131
131
  expect(assigns(:picture_file)).to eq(picture_file)
132
132
  end
133
133
  end
134
134
 
135
- describe "When logged in as Librarian" do
135
+ describe 'When logged in as Librarian' do
136
136
  login_fixture_librarian
137
137
 
138
- it "assigns the requested picture_file as @picture_file" do
138
+ it 'assigns the requested picture_file as @picture_file' do
139
139
  picture_file = PictureFile.find(1)
140
- get :edit, :id => picture_file.id
140
+ get :edit, id: picture_file.id
141
141
  expect(assigns(:picture_file)).to eq(picture_file)
142
142
  end
143
143
  end
144
144
 
145
- describe "When logged in as User" do
145
+ describe 'When logged in as User' do
146
146
  login_fixture_user
147
147
 
148
- it "assigns the requested picture_file as @picture_file" do
148
+ it 'assigns the requested picture_file as @picture_file' do
149
149
  picture_file = PictureFile.find(1)
150
- get :edit, :id => picture_file.id
150
+ get :edit, id: picture_file.id
151
151
  expect(response).to be_forbidden
152
152
  end
153
153
  end
154
154
 
155
- describe "When not logged in" do
156
- it "should not assign the requested picture_file as @picture_file" do
155
+ describe 'When not logged in' do
156
+ it 'should not assign the requested picture_file as @picture_file' do
157
157
  picture_file = PictureFile.find(1)
158
- get :edit, :id => picture_file.id
158
+ get :edit, id: picture_file.id
159
159
  expect(response).to redirect_to(new_user_session_url)
160
160
  end
161
161
  end
162
162
  end
163
163
 
164
- describe "POST create" do
164
+ describe 'POST create' do
165
165
  before(:each) do
166
- @attrs = {:picture_attachable_type => 'Shelf', :picture_attachable_id => 1, :picture => fixture_file_upload("/../../examples/spinner.gif", 'image/gif')}
167
- @invalid_attrs = {:picture_attachable_id => 'invalid', :picture_attachable_type => 'Library'}
166
+ @attrs = { picture_attachable_type: 'Shelf', picture_attachable_id: 1, picture: fixture_file_upload('/../../examples/spinner.gif', 'image/gif') }
167
+ @invalid_attrs = { picture_attachable_id: 'invalid', picture_attachable_type: 'Library' }
168
168
  end
169
169
 
170
- describe "When logged in as Administrator" do
170
+ describe 'When logged in as Administrator' do
171
171
  login_fixture_admin
172
172
 
173
- describe "with valid params" do
174
- it "assigns a newly created picture_file as @picture_file" do
175
- post :create, :picture_file => @attrs
173
+ describe 'with valid params' do
174
+ it 'assigns a newly created picture_file as @picture_file' do
175
+ post :create, picture_file: @attrs
176
176
  expect(assigns(:picture_file)).to be_valid
177
177
  end
178
178
 
179
- it "redirects to the created picture_file" do
180
- post :create, :picture_file => @attrs
179
+ it 'redirects to the created picture_file' do
180
+ post :create, picture_file: @attrs
181
181
  expect(response).to redirect_to(picture_file_url(assigns(:picture_file)))
182
182
  end
183
183
  end
184
184
 
185
- describe "with invalid params" do
186
- it "assigns a newly created but unsaved picture_file as @picture_file" do
187
- post :create, :picture_file => @invalid_attrs
185
+ describe 'with invalid params' do
186
+ it 'assigns a newly created but unsaved picture_file as @picture_file' do
187
+ post :create, picture_file: @invalid_attrs
188
188
  expect(assigns(:picture_file)).not_to be_valid
189
189
  end
190
190
 
191
191
  it "re-renders the 'new' template" do
192
- post :create, :picture_file => @invalid_attrs
193
- expect(response).to render_template("new")
192
+ post :create, picture_file: @invalid_attrs
193
+ expect(response).to render_template('new')
194
194
  end
195
195
  end
196
196
  end
197
197
 
198
- describe "When logged in as Librarian" do
198
+ describe 'When logged in as Librarian' do
199
199
  login_fixture_librarian
200
200
 
201
- describe "with valid params" do
202
- it "assigns a newly created picture_file as @picture_file" do
203
- post :create, :picture_file => @attrs
201
+ describe 'with valid params' do
202
+ it 'assigns a newly created picture_file as @picture_file' do
203
+ post :create, picture_file: @attrs
204
204
  expect(assigns(:picture_file)).to be_valid
205
205
  end
206
206
 
207
- it "redirects to the created picture_file" do
208
- post :create, :picture_file => @attrs
207
+ it 'redirects to the created picture_file' do
208
+ post :create, picture_file: @attrs
209
209
  expect(response).to redirect_to(picture_file_url(assigns(:picture_file)))
210
210
  end
211
211
  end
212
212
 
213
- describe "with invalid params" do
214
- it "assigns a newly created but unsaved picture_file as @picture_file" do
215
- post :create, :picture_file => @invalid_attrs
213
+ describe 'with invalid params' do
214
+ it 'assigns a newly created but unsaved picture_file as @picture_file' do
215
+ post :create, picture_file: @invalid_attrs
216
216
  expect(assigns(:picture_file)).not_to be_valid
217
217
  end
218
218
 
219
219
  it "re-renders the 'new' template" do
220
- post :create, :picture_file => @invalid_attrs
221
- expect(response).to render_template("new")
220
+ post :create, picture_file: @invalid_attrs
221
+ expect(response).to render_template('new')
222
222
  end
223
223
  end
224
224
  end
225
225
 
226
- describe "When logged in as User" do
226
+ describe 'When logged in as User' do
227
227
  login_fixture_user
228
228
 
229
- describe "with valid params" do
230
- it "assigns a newly created picture_file as @picture_file" do
231
- post :create, :picture_file => @attrs
229
+ describe 'with valid params' do
230
+ it 'assigns a newly created picture_file as @picture_file' do
231
+ post :create, picture_file: @attrs
232
232
  expect(assigns(:picture_file)).to be_nil
233
233
  end
234
234
 
235
- it "should be forbidden" do
236
- post :create, :picture_file => @attrs
235
+ it 'should be forbidden' do
236
+ post :create, picture_file: @attrs
237
237
  expect(response).to be_forbidden
238
238
  end
239
239
  end
240
240
 
241
- describe "with invalid params" do
242
- it "assigns a newly created but unsaved picture_file as @picture_file" do
243
- post :create, :picture_file => @invalid_attrs
241
+ describe 'with invalid params' do
242
+ it 'assigns a newly created but unsaved picture_file as @picture_file' do
243
+ post :create, picture_file: @invalid_attrs
244
244
  expect(assigns(:picture_file)).to be_nil
245
245
  end
246
246
 
247
- it "should be forbidden" do
248
- post :create, :picture_file => @invalid_attrs
247
+ it 'should be forbidden' do
248
+ post :create, picture_file: @invalid_attrs
249
249
  expect(response).to be_forbidden
250
250
  end
251
251
  end
252
252
  end
253
253
 
254
- describe "When not logged in" do
255
- describe "with valid params" do
256
- it "assigns a newly created picture_file as @picture_file" do
257
- post :create, :picture_file => @attrs
254
+ describe 'When not logged in' do
255
+ describe 'with valid params' do
256
+ it 'assigns a newly created picture_file as @picture_file' do
257
+ post :create, picture_file: @attrs
258
258
  expect(assigns(:picture_file)).to be_nil
259
259
  end
260
260
 
261
- it "should be forbidden" do
262
- post :create, :picture_file => @attrs
261
+ it 'should be forbidden' do
262
+ post :create, picture_file: @attrs
263
263
  expect(response).to redirect_to(new_user_session_url)
264
264
  end
265
265
  end
266
266
 
267
- describe "with invalid params" do
268
- it "assigns a newly created but unsaved picture_file as @picture_file" do
269
- post :create, :picture_file => @invalid_attrs
267
+ describe 'with invalid params' do
268
+ it 'assigns a newly created but unsaved picture_file as @picture_file' do
269
+ post :create, picture_file: @invalid_attrs
270
270
  expect(assigns(:picture_file)).to be_nil
271
271
  end
272
272
 
273
- it "should be forbidden" do
274
- post :create, :picture_file => @invalid_attrs
273
+ it 'should be forbidden' do
274
+ post :create, picture_file: @invalid_attrs
275
275
  expect(response).to redirect_to(new_user_session_url)
276
276
  end
277
277
  end
278
278
  end
279
279
  end
280
280
 
281
- describe "PUT update" do
281
+ describe 'PUT update' do
282
282
  before(:each) do
283
283
  @picture_file = picture_files(:picture_file_00001)
284
- @attrs = {:picture_attachable_id => '1', :picture_attachable_type => 'Manifestation'}
285
- @invalid_attrs = {:picture_attachable_id => 'invalid', :picture_attachable_type => 'Library'}
284
+ @attrs = { picture_attachable_id: '1', picture_attachable_type: 'Manifestation' }
285
+ @invalid_attrs = { picture_attachable_id: 'invalid', picture_attachable_type: 'Library' }
286
286
  end
287
287
 
288
- describe "When logged in as Administrator" do
288
+ describe 'When logged in as Administrator' do
289
289
  login_fixture_admin
290
290
 
291
- describe "with valid params" do
292
- it "updates the requested picture_file" do
293
- put :update, :id => @picture_file.id, :picture_file => @attrs
291
+ describe 'with valid params' do
292
+ it 'updates the requested picture_file' do
293
+ put :update, id: @picture_file.id, picture_file: @attrs
294
294
  end
295
295
 
296
- it "assigns the requested picture_file as @picture_file" do
297
- put :update, :id => @picture_file.id, :picture_file => @attrs
296
+ it 'assigns the requested picture_file as @picture_file' do
297
+ put :update, id: @picture_file.id, picture_file: @attrs
298
298
  expect(assigns(:picture_file)).to eq(@picture_file)
299
299
  end
300
300
 
301
- it "moves its position when specified" do
302
- put :update, :id => @picture_file.id, :move => 'lower'
301
+ it 'moves its position when specified' do
302
+ put :update, id: @picture_file.id, move: 'lower'
303
303
  expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
304
304
  end
305
305
  end
306
306
 
307
- describe "with invalid params" do
308
- it "assigns the requested picture_file as @picture_file" do
309
- put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
310
- expect(response).to render_template("edit")
307
+ describe 'with invalid params' do
308
+ it 'assigns the requested picture_file as @picture_file' do
309
+ put :update, id: @picture_file.id, picture_file: @invalid_attrs
310
+ expect(response).to render_template('edit')
311
311
  end
312
312
  end
313
313
  end
314
314
 
315
- describe "When logged in as Librarian" do
315
+ describe 'When logged in as Librarian' do
316
316
  login_fixture_librarian
317
317
 
318
- describe "with valid params" do
319
- it "updates the requested picture_file" do
320
- put :update, :id => @picture_file.id, :picture_file => @attrs
318
+ describe 'with valid params' do
319
+ it 'updates the requested picture_file' do
320
+ put :update, id: @picture_file.id, picture_file: @attrs
321
321
  end
322
322
 
323
- it "assigns the requested picture_file as @picture_file" do
324
- put :update, :id => @picture_file.id, :picture_file => @attrs
323
+ it 'assigns the requested picture_file as @picture_file' do
324
+ put :update, id: @picture_file.id, picture_file: @attrs
325
325
  expect(assigns(:picture_file)).to eq(@picture_file)
326
326
  expect(response).to redirect_to(@picture_file)
327
327
  end
328
328
  end
329
329
 
330
- describe "with invalid params" do
331
- it "assigns the picture_file as @picture_file" do
332
- put :update, :id => @picture_file, :picture_file => @invalid_attrs
330
+ describe 'with invalid params' do
331
+ it 'assigns the picture_file as @picture_file' do
332
+ put :update, id: @picture_file, picture_file: @invalid_attrs
333
333
  expect(assigns(:picture_file)).not_to be_valid
334
334
  end
335
335
 
336
336
  it "re-renders the 'edit' template" do
337
- put :update, :id => @picture_file, :picture_file => @invalid_attrs
338
- expect(response).to render_template("edit")
337
+ put :update, id: @picture_file, picture_file: @invalid_attrs
338
+ expect(response).to render_template('edit')
339
339
  end
340
340
  end
341
341
  end
342
342
 
343
- describe "When logged in as User" do
343
+ describe 'When logged in as User' do
344
344
  login_fixture_user
345
345
 
346
- describe "with valid params" do
347
- it "updates the requested picture_file" do
348
- put :update, :id => @picture_file.id, :picture_file => @attrs
346
+ describe 'with valid params' do
347
+ it 'updates the requested picture_file' do
348
+ put :update, id: @picture_file.id, picture_file: @attrs
349
349
  end
350
350
 
351
- it "assigns the requested picture_file as @picture_file" do
352
- put :update, :id => @picture_file.id, :picture_file => @attrs
351
+ it 'assigns the requested picture_file as @picture_file' do
352
+ put :update, id: @picture_file.id, picture_file: @attrs
353
353
  expect(assigns(:picture_file)).to eq(@picture_file)
354
354
  expect(response).to be_forbidden
355
355
  end
356
356
  end
357
357
 
358
- describe "with invalid params" do
359
- it "assigns the requested picture_file as @picture_file" do
360
- put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
358
+ describe 'with invalid params' do
359
+ it 'assigns the requested picture_file as @picture_file' do
360
+ put :update, id: @picture_file.id, picture_file: @invalid_attrs
361
361
  expect(response).to be_forbidden
362
362
  end
363
363
  end
364
364
  end
365
365
 
366
- describe "When not logged in" do
367
- describe "with valid params" do
368
- it "updates the requested picture_file" do
369
- put :update, :id => @picture_file.id, :picture_file => @attrs
366
+ describe 'When not logged in' do
367
+ describe 'with valid params' do
368
+ it 'updates the requested picture_file' do
369
+ put :update, id: @picture_file.id, picture_file: @attrs
370
370
  end
371
371
 
372
- it "should be forbidden" do
373
- put :update, :id => @picture_file.id, :picture_file => @attrs
372
+ it 'should be forbidden' do
373
+ put :update, id: @picture_file.id, picture_file: @attrs
374
374
  expect(response).to redirect_to(new_user_session_url)
375
375
  end
376
376
  end
377
377
 
378
- describe "with invalid params" do
379
- it "assigns the requested picture_file as @picture_file" do
380
- put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
378
+ describe 'with invalid params' do
379
+ it 'assigns the requested picture_file as @picture_file' do
380
+ put :update, id: @picture_file.id, picture_file: @invalid_attrs
381
381
  expect(response).to redirect_to(new_user_session_url)
382
382
  end
383
383
  end
384
384
  end
385
385
  end
386
386
 
387
- describe "DELETE destroy" do
387
+ describe 'DELETE destroy' do
388
388
  before(:each) do
389
389
  @picture_file = PictureFile.find(1)
390
390
  end
391
391
 
392
- describe "When logged in as Administrator" do
392
+ describe 'When logged in as Administrator' do
393
393
  login_fixture_admin
394
394
 
395
- it "destroys the requested picture_file" do
396
- delete :destroy, :id => @picture_file.id
395
+ it 'destroys the requested picture_file' do
396
+ delete :destroy, id: @picture_file.id
397
397
  end
398
398
 
399
- it "redirects to the picture_files list" do
400
- delete :destroy, :id => @picture_file.id
399
+ it 'redirects to the picture_files list' do
400
+ delete :destroy, id: @picture_file.id
401
401
  expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
402
402
  end
403
403
  end
404
404
 
405
- describe "When logged in as Librarian" do
405
+ describe 'When logged in as Librarian' do
406
406
  login_fixture_librarian
407
407
 
408
- it "destroys the requested picture_file" do
409
- delete :destroy, :id => @picture_file.id
408
+ it 'destroys the requested picture_file' do
409
+ delete :destroy, id: @picture_file.id
410
410
  end
411
411
 
412
- it "should be forbidden" do
413
- delete :destroy, :id => @picture_file.id
412
+ it 'should be forbidden' do
413
+ delete :destroy, id: @picture_file.id
414
414
  expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
415
415
  end
416
416
  end
417
417
 
418
- describe "When logged in as User" do
418
+ describe 'When logged in as User' do
419
419
  login_fixture_user
420
420
 
421
- it "destroys the requested picture_file" do
422
- delete :destroy, :id => @picture_file.id
421
+ it 'destroys the requested picture_file' do
422
+ delete :destroy, id: @picture_file.id
423
423
  end
424
424
 
425
- it "should be forbidden" do
426
- delete :destroy, :id => @picture_file.id
425
+ it 'should be forbidden' do
426
+ delete :destroy, id: @picture_file.id
427
427
  expect(response).to be_forbidden
428
428
  end
429
429
  end
430
430
 
431
- describe "When not logged in" do
432
- it "destroys the requested picture_file" do
433
- delete :destroy, :id => @picture_file.id
431
+ describe 'When not logged in' do
432
+ it 'destroys the requested picture_file' do
433
+ delete :destroy, id: @picture_file.id
434
434
  end
435
435
 
436
- it "should be forbidden" do
437
- delete :destroy, :id => @picture_file.id
436
+ it 'should be forbidden' do
437
+ delete :destroy, id: @picture_file.id
438
438
  expect(response).to redirect_to(new_user_session_url)
439
439
  end
440
440
  end