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,113 +5,113 @@ describe ImportRequestsController 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 import_requests as @import_requests" do
12
+ it 'assigns all import_requests as @import_requests' do
13
13
  get :index
14
14
  expect(assigns(:import_requests)).to eq(ImportRequest.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 import_requests as @import_requests" do
21
+ it 'assigns all import_requests as @import_requests' do
22
22
  get :index
23
23
  expect(assigns(:import_requests)).to eq(ImportRequest.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 empty as @import_requests" do
30
+ it 'assigns empty as @import_requests' do
31
31
  get :index
32
32
  expect(assigns(:import_requests)).to be_nil
33
33
  end
34
34
  end
35
35
 
36
- describe "When not logged in" do
37
- it "assigns empty as @import_requests" do
36
+ describe 'When not logged in' do
37
+ it 'assigns empty as @import_requests' do
38
38
  get :index
39
39
  expect(assigns(:import_requests)).to be_nil
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 import_request as @import_request" do
48
+ it 'assigns the requested import_request as @import_request' do
49
49
  import_request = import_requests(:one)
50
- get :show, :id => import_request.id
50
+ get :show, id: import_request.id
51
51
  expect(assigns(:import_request)).to eq(import_request)
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 import_request as @import_request" do
58
+ it 'assigns the requested import_request as @import_request' do
59
59
  import_request = import_requests(:one)
60
- get :show, :id => import_request.id
60
+ get :show, id: import_request.id
61
61
  expect(assigns(:import_request)).to eq(import_request)
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 import_request as @import_request" do
68
+ it 'assigns the requested import_request as @import_request' do
69
69
  import_request = import_requests(:one)
70
- get :show, :id => import_request.id
70
+ get :show, id: import_request.id
71
71
  expect(assigns(:import_request)).to eq(import_request)
72
72
  end
73
73
  end
74
74
 
75
- describe "When not logged in" do
76
- it "assigns the requested import_request as @import_request" do
75
+ describe 'When not logged in' do
76
+ it 'assigns the requested import_request as @import_request' do
77
77
  import_request = import_requests(:one)
78
- get :show, :id => import_request.id
78
+ get :show, id: import_request.id
79
79
  expect(assigns(:import_request)).to eq(import_request)
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 import_request as @import_request" do
88
+ it 'assigns the requested import_request as @import_request' do
89
89
  get :new
90
90
  expect(assigns(:import_request)).to_not be_valid
91
91
  end
92
92
  end
93
93
 
94
- describe "When logged in as Librarian" do
94
+ describe 'When logged in as Librarian' do
95
95
  login_fixture_librarian
96
96
 
97
- it "assigns the requested import_request as @import_request" do
97
+ it 'assigns the requested import_request as @import_request' do
98
98
  get :new
99
99
  expect(assigns(:import_request)).to_not be_valid
100
100
  end
101
101
  end
102
102
 
103
- describe "When logged in as User" do
103
+ describe 'When logged in as User' do
104
104
  login_fixture_user
105
105
 
106
- it "should not assign the requested import_request as @import_request" do
106
+ it 'should not assign the requested import_request as @import_request' do
107
107
  get :new
108
108
  expect(assigns(:import_request)).to be_nil
109
109
  expect(response).to be_forbidden
110
110
  end
111
111
  end
112
112
 
113
- describe "When not logged in" do
114
- it "should not assign the requested import_request as @import_request" do
113
+ describe 'When not logged in' do
114
+ it 'should not assign the requested import_request as @import_request' do
115
115
  get :new
116
116
  expect(assigns(:import_request)).to be_nil
117
117
  expect(response).to redirect_to(new_user_session_url)
@@ -119,86 +119,87 @@ describe ImportRequestsController do
119
119
  end
120
120
  end
121
121
 
122
- describe "GET edit" do
123
- describe "When logged in as Administrator" do
122
+ describe 'GET edit' do
123
+ describe 'When logged in as Administrator' do
124
124
  login_fixture_admin
125
125
 
126
- it "assigns the requested import_request as @import_request" do
127
- import_request = FactoryGirl.create(:import_request, :isbn => '9784797350999')
128
- get :edit, :id => import_request.id
126
+ it 'assigns the requested import_request as @import_request' do
127
+ import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
128
+ get :edit, id: import_request.id
129
129
  expect(assigns(:import_request)).to eq(import_request)
130
130
  end
131
131
  end
132
132
 
133
- describe "When logged in as Librarian" do
133
+ describe 'When logged in as Librarian' do
134
134
  login_fixture_librarian
135
135
 
136
- it "assigns the requested import_request as @import_request" do
137
- import_request = FactoryGirl.create(:import_request, :isbn => '9784797350999')
138
- get :edit, :id => import_request.id
136
+ it 'assigns the requested import_request as @import_request' do
137
+ import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
138
+ get :edit, id: import_request.id
139
139
  expect(assigns(:import_request)).to eq(import_request)
140
140
  end
141
141
  end
142
142
 
143
- describe "When logged in as User" do
143
+ describe 'When logged in as User' do
144
144
  login_fixture_user
145
145
 
146
- it "assigns the requested import_request as @import_request" do
147
- import_request = FactoryGirl.create(:import_request, :isbn => '9784797350999')
148
- get :edit, :id => import_request.id
146
+ it 'assigns the requested import_request as @import_request' do
147
+ import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
148
+ get :edit, id: import_request.id
149
149
  expect(response).to be_forbidden
150
150
  end
151
151
  end
152
152
 
153
- describe "When not logged in" do
154
- it "should not assign the requested import_request as @import_request" do
155
- import_request = FactoryGirl.create(:import_request, :isbn => '9784797350999')
156
- get :edit, :id => import_request.id
153
+ describe 'When not logged in' do
154
+ it 'should not assign the requested import_request as @import_request' do
155
+ import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
156
+ get :edit, id: import_request.id
157
157
  expect(response).to redirect_to(new_user_session_url)
158
158
  end
159
159
  end
160
160
  end
161
161
 
162
- describe "POST create" do
162
+ describe 'POST create' do
163
163
  before(:each) do
164
- @attrs = {:isbn => '9784873114422'}
165
- @invalid_attrs = {:isbn => 'invalid'}
164
+ @attrs = { isbn: '9784873114422' }
165
+ @invalid_attrs = { isbn: 'invalid' }
166
166
  end
167
167
 
168
- describe "When logged in as Administrator" do
168
+ describe 'When logged in as Administrator' do
169
169
  login_fixture_admin
170
170
 
171
- describe "with valid params", :vcr => true do
172
- it "assigns a newly created import_request as @import_request" do
173
- post :create, :import_request => @attrs
174
- assigns(:import_request).manifestation.save! #should be_valid
171
+ describe 'with valid params', vcr: true do
172
+ it 'assigns a newly created import_request as @import_request' do
173
+ post :create, import_request: @attrs
174
+ assigns(:import_request).manifestation.save! # should be_valid
175
175
  end
176
176
 
177
- it "redirects to the created import_request" do
178
- post :create, :import_request => @attrs
177
+ it 'redirects to the created import_request' do
178
+ post :create, import_request: @attrs
179
179
  expect(response).to redirect_to manifestation_url(assigns(:import_request).manifestation)
180
180
  end
181
181
  end
182
182
 
183
- describe "with invalid params" do
184
- it "assigns a newly created but unsaved import_request as @import_request" do
185
- post :create, :import_request => @invalid_attrs
183
+ describe 'with invalid params' do
184
+ it 'assigns a newly created but unsaved import_request as @import_request' do
185
+ post :create, import_request: @invalid_attrs
186
186
  expect(assigns(:import_request)).to_not be_valid
187
187
  end
188
188
 
189
189
  it "re-renders the 'new' template" do
190
- post :create, :import_request => @invalid_attrs
191
- expect(response).to render_template("new")
190
+ post :create, import_request: @invalid_attrs
191
+ expect(response).to render_template('new')
192
192
  end
193
193
  end
194
194
 
195
- describe "with isbn which is already imported" do
196
- it "assigns a newly created import_request as @import_request" do
197
- post :create, :import_request => {:isbn => manifestations(:manifestation_00001).identifier_contents(:isbn).first}
195
+ describe 'with isbn which is already imported' do
196
+ it 'assigns a newly created import_request as @import_request' do
197
+ post :create, import_request: { isbn: manifestations(:manifestation_00001).identifier_contents(:isbn).first }
198
198
  expect(assigns(:import_request)).to be_valid
199
199
  end
200
- it "redirects to the created import_request", :vcr => true do
201
- post :create, :import_request => @attrs
200
+
201
+ it 'redirects to the created import_request', vcr: true do
202
+ post :create, import_request: @attrs
202
203
  expect(response).to redirect_to manifestation_url(assigns(:import_request).manifestation)
203
204
  end
204
205
  end
@@ -207,241 +208,241 @@ describe ImportRequestsController do
207
208
  end
208
209
  end
209
210
 
210
- describe "When logged in as Librarian" do
211
+ describe 'When logged in as Librarian' do
211
212
  login_fixture_librarian
212
213
 
213
- describe "with valid params", :vcr => true do
214
- it "assigns a newly created import_request as @import_request" do
215
- post :create, :import_request => @attrs
214
+ describe 'with valid params', vcr: true do
215
+ it 'assigns a newly created import_request as @import_request' do
216
+ post :create, import_request: @attrs
216
217
  expect(assigns(:import_request)).to be_valid
217
218
  end
218
219
 
219
- it "redirects to the created import_request" do
220
- post :create, :import_request => @attrs
220
+ it 'redirects to the created import_request' do
221
+ post :create, import_request: @attrs
221
222
  expect(response).to redirect_to manifestation_url(assigns(:import_request).manifestation)
222
223
  end
223
224
  end
224
225
 
225
- describe "with invalid params" do
226
- it "assigns a newly created but unsaved import_request as @import_request" do
227
- post :create, :import_request => @invalid_attrs
226
+ describe 'with invalid params' do
227
+ it 'assigns a newly created but unsaved import_request as @import_request' do
228
+ post :create, import_request: @invalid_attrs
228
229
  expect(assigns(:import_request)).to_not be_valid
229
230
  end
230
231
 
231
232
  it "re-renders the 'new' template" do
232
- post :create, :import_request => @invalid_attrs
233
- expect(response).to render_template("new")
233
+ post :create, import_request: @invalid_attrs
234
+ expect(response).to render_template('new')
234
235
  end
235
236
  end
236
237
  end
237
238
 
238
- describe "When logged in as User" do
239
+ describe 'When logged in as User' do
239
240
  login_fixture_user
240
241
 
241
- describe "with valid params" do
242
- it "assigns a newly created import_request as @import_request" do
243
- post :create, :import_request => @attrs
242
+ describe 'with valid params' do
243
+ it 'assigns a newly created import_request as @import_request' do
244
+ post :create, import_request: @attrs
244
245
  expect(assigns(:import_request)).to be_nil
245
246
  end
246
247
 
247
- it "should be forbidden" do
248
- post :create, :import_request => @attrs
248
+ it 'should be forbidden' do
249
+ post :create, import_request: @attrs
249
250
  expect(response).to be_forbidden
250
251
  end
251
252
  end
252
253
 
253
- describe "with invalid params" do
254
- it "assigns a newly created but unsaved import_request as @import_request" do
255
- post :create, :import_request => @invalid_attrs
254
+ describe 'with invalid params' do
255
+ it 'assigns a newly created but unsaved import_request as @import_request' do
256
+ post :create, import_request: @invalid_attrs
256
257
  expect(assigns(:import_request)).to be_nil
257
258
  end
258
259
 
259
- it "should be forbidden" do
260
- post :create, :import_request => @invalid_attrs
260
+ it 'should be forbidden' do
261
+ post :create, import_request: @invalid_attrs
261
262
  expect(response).to be_forbidden
262
263
  end
263
264
  end
264
265
  end
265
266
 
266
- describe "When not logged in" do
267
- describe "with valid params" do
268
- it "assigns a newly created import_request as @import_request" do
269
- post :create, :import_request => @attrs
267
+ describe 'When not logged in' do
268
+ describe 'with valid params' do
269
+ it 'assigns a newly created import_request as @import_request' do
270
+ post :create, import_request: @attrs
270
271
  expect(assigns(:import_request)).to be_nil
271
272
  end
272
273
 
273
- it "should be forbidden" do
274
- post :create, :import_request => @attrs
274
+ it 'should be forbidden' do
275
+ post :create, import_request: @attrs
275
276
  expect(response).to redirect_to(new_user_session_url)
276
277
  end
277
278
  end
278
279
 
279
- describe "with invalid params" do
280
- it "assigns a newly created but unsaved import_request as @import_request" do
281
- post :create, :import_request => @invalid_attrs
280
+ describe 'with invalid params' do
281
+ it 'assigns a newly created but unsaved import_request as @import_request' do
282
+ post :create, import_request: @invalid_attrs
282
283
  expect(assigns(:import_request)).to be_nil
283
284
  end
284
285
 
285
- it "should be forbidden" do
286
- post :create, :import_request => @invalid_attrs
286
+ it 'should be forbidden' do
287
+ post :create, import_request: @invalid_attrs
287
288
  expect(response).to redirect_to(new_user_session_url)
288
289
  end
289
290
  end
290
291
  end
291
292
  end
292
293
 
293
- describe "PUT update" do
294
+ describe 'PUT update' do
294
295
  before(:each) do
295
296
  @import_request = import_requests(:one)
296
- @attrs = {:isbn => '9784797350999'}
297
- @invalid_attrs = {:isbn => 'invalid'}
297
+ @attrs = { isbn: '9784797350999' }
298
+ @invalid_attrs = { isbn: 'invalid' }
298
299
  end
299
300
 
300
- describe "When logged in as Administrator" do
301
+ describe 'When logged in as Administrator' do
301
302
  login_fixture_admin
302
303
 
303
- describe "with valid params" do
304
- it "updates the requested import_request" do
305
- put :update, :id => @import_request.id, :import_request => @attrs
304
+ describe 'with valid params' do
305
+ it 'updates the requested import_request' do
306
+ put :update, id: @import_request.id, import_request: @attrs
306
307
  end
307
308
 
308
- it "assigns the requested import_request as @import_request" do
309
- put :update, :id => @import_request.id, :import_request => @attrs
309
+ it 'assigns the requested import_request as @import_request' do
310
+ put :update, id: @import_request.id, import_request: @attrs
310
311
  expect(assigns(:import_request)).to eq(@import_request)
311
312
  end
312
313
  end
313
314
 
314
- describe "with invalid params" do
315
- it "assigns the requested import_request as @import_request" do
316
- put :update, :id => @import_request.id, :import_request => @invalid_attrs
317
- expect(response).to render_template("edit")
315
+ describe 'with invalid params' do
316
+ it 'assigns the requested import_request as @import_request' do
317
+ put :update, id: @import_request.id, import_request: @invalid_attrs
318
+ expect(response).to render_template('edit')
318
319
  end
319
320
  end
320
321
  end
321
322
 
322
- describe "When logged in as Librarian" do
323
+ describe 'When logged in as Librarian' do
323
324
  login_fixture_librarian
324
325
 
325
- describe "with valid params" do
326
- it "updates the requested import_request" do
327
- put :update, :id => @import_request.id, :import_request => @attrs
326
+ describe 'with valid params' do
327
+ it 'updates the requested import_request' do
328
+ put :update, id: @import_request.id, import_request: @attrs
328
329
  end
329
330
 
330
- it "assigns the requested import_request as @import_request" do
331
- put :update, :id => @import_request.id, :import_request => @attrs
331
+ it 'assigns the requested import_request as @import_request' do
332
+ put :update, id: @import_request.id, import_request: @attrs
332
333
  expect(assigns(:import_request)).to eq(@import_request)
333
334
  expect(response).to redirect_to(@import_request)
334
335
  end
335
336
  end
336
337
 
337
- describe "with invalid params" do
338
- it "assigns the import_request as @import_request" do
339
- put :update, :id => @import_request, :import_request => @invalid_attrs
338
+ describe 'with invalid params' do
339
+ it 'assigns the import_request as @import_request' do
340
+ put :update, id: @import_request, import_request: @invalid_attrs
340
341
  expect(assigns(:import_request)).to_not be_valid
341
342
  end
342
343
 
343
344
  it "re-renders the 'edit' template" do
344
- put :update, :id => @import_request, :import_request => @invalid_attrs
345
- expect(response).to render_template("edit")
345
+ put :update, id: @import_request, import_request: @invalid_attrs
346
+ expect(response).to render_template('edit')
346
347
  end
347
348
  end
348
349
  end
349
350
 
350
- describe "When logged in as User" do
351
+ describe 'When logged in as User' do
351
352
  login_fixture_user
352
353
 
353
- describe "with valid params" do
354
- it "updates the requested import_request" do
355
- put :update, :id => @import_request.id, :import_request => @attrs
354
+ describe 'with valid params' do
355
+ it 'updates the requested import_request' do
356
+ put :update, id: @import_request.id, import_request: @attrs
356
357
  end
357
358
 
358
- it "assigns the requested import_request as @import_request" do
359
- put :update, :id => @import_request.id, :import_request => @attrs
359
+ it 'assigns the requested import_request as @import_request' do
360
+ put :update, id: @import_request.id, import_request: @attrs
360
361
  expect(assigns(:import_request)).to eq(@import_request)
361
362
  expect(response).to be_forbidden
362
363
  end
363
364
  end
364
365
 
365
- describe "with invalid params" do
366
- it "assigns the requested import_request as @import_request" do
367
- put :update, :id => @import_request.id, :import_request => @invalid_attrs
366
+ describe 'with invalid params' do
367
+ it 'assigns the requested import_request as @import_request' do
368
+ put :update, id: @import_request.id, import_request: @invalid_attrs
368
369
  expect(response).to be_forbidden
369
370
  end
370
371
  end
371
372
  end
372
373
 
373
- describe "When not logged in" do
374
- describe "with valid params" do
375
- it "updates the requested import_request" do
376
- put :update, :id => @import_request.id, :import_request => @attrs
374
+ describe 'When not logged in' do
375
+ describe 'with valid params' do
376
+ it 'updates the requested import_request' do
377
+ put :update, id: @import_request.id, import_request: @attrs
377
378
  end
378
379
 
379
- it "should be redirected to new session url" do
380
- put :update, :id => @import_request.id, :import_request => @attrs
380
+ it 'should be redirected to new session url' do
381
+ put :update, id: @import_request.id, import_request: @attrs
381
382
  expect(response).to redirect_to(new_user_session_url)
382
383
  end
383
384
  end
384
385
 
385
- describe "with invalid params" do
386
- it "assigns the requested import_request as @import_request" do
387
- put :update, :id => @import_request.id, :import_request => @invalid_attrs
386
+ describe 'with invalid params' do
387
+ it 'assigns the requested import_request as @import_request' do
388
+ put :update, id: @import_request.id, import_request: @invalid_attrs
388
389
  expect(response).to redirect_to(new_user_session_url)
389
390
  end
390
391
  end
391
392
  end
392
393
  end
393
394
 
394
- describe "DELETE destroy" do
395
+ describe 'DELETE destroy' do
395
396
  before(:each) do
396
397
  @import_request = import_requests(:one)
397
398
  end
398
399
 
399
- describe "When logged in as Administrator" do
400
+ describe 'When logged in as Administrator' do
400
401
  login_fixture_admin
401
402
 
402
- it "destroys the requested import_request" do
403
- delete :destroy, :id => @import_request.id
403
+ it 'destroys the requested import_request' do
404
+ delete :destroy, id: @import_request.id
404
405
  end
405
406
 
406
- it "redirects to the import_requests list" do
407
- delete :destroy, :id => @import_request.id
407
+ it 'redirects to the import_requests list' do
408
+ delete :destroy, id: @import_request.id
408
409
  expect(response).to redirect_to(import_requests_url)
409
410
  end
410
411
  end
411
412
 
412
- describe "When logged in as Librarian" do
413
+ describe 'When logged in as Librarian' do
413
414
  login_fixture_librarian
414
415
 
415
- it "destroys the requested import_request" do
416
- delete :destroy, :id => @import_request.id
416
+ it 'destroys the requested import_request' do
417
+ delete :destroy, id: @import_request.id
417
418
  end
418
419
 
419
- it "should be forbidden" do
420
- delete :destroy, :id => @import_request.id
420
+ it 'should be forbidden' do
421
+ delete :destroy, id: @import_request.id
421
422
  expect(response).to redirect_to(import_requests_url)
422
423
  end
423
424
  end
424
425
 
425
- describe "When logged in as User" do
426
+ describe 'When logged in as User' do
426
427
  login_fixture_user
427
428
 
428
- it "destroys the requested import_request" do
429
- delete :destroy, :id => @import_request.id
429
+ it 'destroys the requested import_request' do
430
+ delete :destroy, id: @import_request.id
430
431
  end
431
432
 
432
- it "should be forbidden" do
433
- delete :destroy, :id => @import_request.id
433
+ it 'should be forbidden' do
434
+ delete :destroy, id: @import_request.id
434
435
  expect(response).to be_forbidden
435
436
  end
436
437
  end
437
438
 
438
- describe "When not logged in" do
439
- it "destroys the requested import_request" do
440
- delete :destroy, :id => @import_request.id
439
+ describe 'When not logged in' do
440
+ it 'destroys the requested import_request' do
441
+ delete :destroy, id: @import_request.id
441
442
  end
442
443
 
443
- it "should be forbidden" do
444
- delete :destroy, :id => @import_request.id
444
+ it 'should be forbidden' do
445
+ delete :destroy, id: @import_request.id
445
446
  expect(response).to redirect_to(new_user_session_url)
446
447
  end
447
448
  end