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
@@ -3,37 +3,37 @@ require 'rails_helper'
3
3
  describe ResourceExportFilesController do
4
4
  fixtures :all
5
5
 
6
- describe "GET index" do
7
- describe "When logged in as Administrator" do
6
+ describe 'GET index' do
7
+ describe 'When logged in as Administrator' do
8
8
  login_fixture_admin
9
9
 
10
- it "assigns all resource_export_files as @resource_export_files" do
10
+ it 'assigns all resource_export_files as @resource_export_files' do
11
11
  get :index
12
12
  expect(assigns(:resource_export_files)).to eq(ResourceExportFile.order('id DESC').page(1))
13
13
  end
14
14
  end
15
15
 
16
- describe "When logged in as Librarian" do
16
+ describe 'When logged in as Librarian' do
17
17
  login_fixture_librarian
18
18
 
19
- it "assigns all resource_export_files as @resource_export_files" do
19
+ it 'assigns all resource_export_files as @resource_export_files' do
20
20
  get :index
21
21
  expect(assigns(:resource_export_files)).to eq(ResourceExportFile.order('id DESC').page(1))
22
22
  end
23
23
  end
24
24
 
25
- describe "When logged in as User" do
25
+ describe 'When logged in as User' do
26
26
  login_fixture_user
27
27
 
28
- it "assigns empty as @resource_export_files" do
28
+ it 'assigns empty as @resource_export_files' do
29
29
  get :index
30
30
  expect(assigns(:resource_export_files)).to be_nil
31
31
  expect(response).to be_forbidden
32
32
  end
33
33
  end
34
34
 
35
- describe "When not logged in" do
36
- it "assigns empty as @resource_export_files" do
35
+ describe 'When not logged in' do
36
+ it 'assigns empty as @resource_export_files' do
37
37
  get :index
38
38
  expect(assigns(:resource_export_files)).to be_nil
39
39
  expect(response).to redirect_to(new_user_session_url)
@@ -41,39 +41,39 @@ describe ResourceExportFilesController do
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 resource_export_file as @resource_export_file" do
48
+ it 'assigns the requested resource_export_file as @resource_export_file' do
49
49
  get :show, id: resource_export_files(:resource_export_file_00003).id
50
50
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
51
51
  expect(response).to be_success
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 resource_export_file as @resource_export_file" do
58
+ it 'assigns the requested resource_export_file as @resource_export_file' do
59
59
  get :show, id: resource_export_files(:resource_export_file_00003).id
60
60
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
61
61
  expect(response).to be_success
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 resource_export_file as @resource_export_file" do
68
+ it 'assigns the requested resource_export_file as @resource_export_file' do
69
69
  get :show, id: resource_export_files(:resource_export_file_00003).id
70
70
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
71
71
  expect(response).to be_forbidden
72
72
  end
73
73
  end
74
74
 
75
- describe "When not logged in" do
76
- it "assigns the requested resource_export_file as @resource_export_file" do
75
+ describe 'When not logged in' do
76
+ it 'assigns the requested resource_export_file as @resource_export_file' do
77
77
  get :show, id: resource_export_files(:resource_export_file_00003).id
78
78
  expect(assigns(:resource_export_file)).to eq(resource_export_files(:resource_export_file_00003))
79
79
  expect(response).to redirect_to(new_user_session_url)
@@ -81,39 +81,39 @@ describe ResourceExportFilesController do
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 resource_export_file as @resource_export_file" do
88
+ it 'assigns the requested resource_export_file as @resource_export_file' do
89
89
  get :new
90
90
  expect(assigns(:resource_export_file)).to be_valid
91
91
  expect(response).to be_success
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 "should not assign the requested resource_export_file as @resource_export_file" do
98
+ it 'should not assign the requested resource_export_file as @resource_export_file' do
99
99
  get :new
100
100
  expect(assigns(:resource_export_file)).to be_valid
101
101
  expect(response).to be_success
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 resource_export_file as @resource_export_file" do
108
+ it 'should not assign the requested resource_export_file as @resource_export_file' do
109
109
  get :new
110
110
  expect(assigns(:resource_export_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 resource_export_file as @resource_export_file" do
115
+ describe 'When not logged in' do
116
+ it 'should not assign the requested resource_export_file as @resource_export_file' do
117
117
  get :new
118
118
  expect(assigns(:resource_export_file)).to be_nil
119
119
  expect(response).to redirect_to(new_user_session_url)
@@ -121,70 +121,70 @@ describe ResourceExportFilesController do
121
121
  end
122
122
  end
123
123
 
124
- describe "POST create" do
125
- describe "When logged in as Librarian" do
124
+ describe 'POST create' do
125
+ describe 'When logged in as Librarian' do
126
126
  login_fixture_librarian
127
127
 
128
- it "should create agent_export_file" do
129
- post :create, resource_export_file: {mode: 'export'}
128
+ it 'should create agent_export_file' do
129
+ post :create, resource_export_file: { mode: 'export' }
130
130
  expect(assigns(:resource_export_file)).to be_valid
131
131
  assigns(:resource_export_file).user.username.should eq @user.username
132
132
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
133
133
  end
134
134
  end
135
135
 
136
- describe "When logged in as User" do
136
+ describe 'When logged in as User' do
137
137
  login_fixture_user
138
138
 
139
- it "should be forbidden" do
140
- post :create, resource_export_file: {mode: 'export'}
139
+ it 'should be forbidden' do
140
+ post :create, resource_export_file: { mode: 'export' }
141
141
  assigns(:resource_export_file).should be_nil
142
142
  expect(response).to be_forbidden
143
143
  end
144
144
  end
145
145
 
146
- describe "When not logged in" do
147
- it "should be redirected to new session url" do
148
- post :create, resource_export_file: {mode: 'export'}
146
+ describe 'When not logged in' do
147
+ it 'should be redirected to new session url' do
148
+ post :create, resource_export_file: { mode: 'export' }
149
149
  assigns(:resource_export_file).should be_nil
150
150
  expect(response).to redirect_to new_user_session_url
151
151
  end
152
152
  end
153
153
  end
154
154
 
155
- describe "GET edit" do
156
- describe "When logged in as Administrator" do
155
+ describe 'GET edit' do
156
+ describe 'When logged in as Administrator' do
157
157
  login_fixture_admin
158
158
 
159
- it "assigns the requested resource_export_file as @resource_export_file" do
159
+ it 'assigns the requested resource_export_file as @resource_export_file' do
160
160
  resource_export_file = resource_export_files(:resource_export_file_00001)
161
161
  get :edit, id: resource_export_file.id
162
162
  expect(assigns(:resource_export_file)).to eq(resource_export_file)
163
163
  end
164
164
  end
165
165
 
166
- describe "When logged in as Librarian" do
166
+ describe 'When logged in as Librarian' do
167
167
  login_fixture_librarian
168
168
 
169
- it "assigns the requested resource_export_file as @resource_export_file" do
169
+ it 'assigns the requested resource_export_file as @resource_export_file' do
170
170
  resource_export_file = resource_export_files(:resource_export_file_00001)
171
171
  get :edit, id: resource_export_file.id
172
172
  expect(assigns(:resource_export_file)).to eq(resource_export_file)
173
173
  end
174
174
  end
175
175
 
176
- describe "When logged in as User" do
176
+ describe 'When logged in as User' do
177
177
  login_fixture_user
178
178
 
179
- it "assigns the requested resource_export_file as @resource_export_file" do
179
+ it 'assigns the requested resource_export_file as @resource_export_file' do
180
180
  resource_export_file = resource_export_files(:resource_export_file_00001)
181
181
  get :edit, id: resource_export_file.id
182
182
  expect(response).to be_forbidden
183
183
  end
184
184
  end
185
185
 
186
- describe "When not logged in" do
187
- it "should not assign the requested resource_export_file as @resource_export_file" do
186
+ describe 'When not logged in' do
187
+ it 'should not assign the requested resource_export_file as @resource_export_file' do
188
188
  resource_export_file = resource_export_files(:resource_export_file_00001)
189
189
  get :edit, id: resource_export_file.id
190
190
  expect(response).to redirect_to(new_user_session_url)
@@ -192,92 +192,92 @@ describe ResourceExportFilesController do
192
192
  end
193
193
  end
194
194
 
195
- describe "PUT update" do
196
- describe "When logged in as Administrator" do
195
+ describe 'PUT update' do
196
+ describe 'When logged in as Administrator' do
197
197
  login_fixture_admin
198
198
 
199
- it "should update resource_export_file" do
200
- put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
199
+ it 'should update resource_export_file' do
200
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: { mode: 'export' }
201
201
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
202
202
  end
203
203
  end
204
204
 
205
- describe "When logged in as Librarian" do
205
+ describe 'When logged in as Librarian' do
206
206
  login_fixture_librarian
207
207
 
208
- it "should update resource_export_file" do
209
- put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
208
+ it 'should update resource_export_file' do
209
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: { mode: 'export' }
210
210
  expect(response).to redirect_to resource_export_file_url(assigns(:resource_export_file))
211
211
  end
212
212
  end
213
213
 
214
- describe "When logged in as User" do
214
+ describe 'When logged in as User' do
215
215
  login_fixture_user
216
216
 
217
- it "should not update resource_export_file" do
218
- put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
217
+ it 'should not update resource_export_file' do
218
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: { mode: 'export' }
219
219
  expect(response).to be_forbidden
220
220
  end
221
221
  end
222
222
 
223
- describe "When not logged in" do
224
- it "should not update resource_export_file" do
225
- put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: {mode: 'export'}
223
+ describe 'When not logged in' do
224
+ it 'should not update resource_export_file' do
225
+ put :update, id: resource_export_files(:resource_export_file_00003).id, resource_export_file: { mode: 'export' }
226
226
  expect(response).to redirect_to new_user_session_url
227
227
  end
228
228
  end
229
229
  end
230
230
 
231
- describe "DELETE destroy" do
231
+ describe 'DELETE destroy' do
232
232
  before(:each) do
233
233
  @resource_export_file = resource_export_files(:resource_export_file_00001)
234
234
  end
235
235
 
236
- describe "When logged in as Administrator" do
236
+ describe 'When logged in as Administrator' do
237
237
  login_fixture_admin
238
238
 
239
- it "destroys the requested resource_export_file" do
239
+ it 'destroys the requested resource_export_file' do
240
240
  delete :destroy, id: @resource_export_file.id
241
241
  end
242
242
 
243
- it "redirects to the resource_export_files list" do
243
+ it 'redirects to the resource_export_files list' do
244
244
  delete :destroy, id: @resource_export_file.id
245
245
  expect(response).to redirect_to(resource_export_files_url)
246
246
  end
247
247
  end
248
248
 
249
- describe "When logged in as Librarian" do
249
+ describe 'When logged in as Librarian' do
250
250
  login_fixture_librarian
251
251
 
252
- it "destroys the requested resource_export_file" do
252
+ it 'destroys the requested resource_export_file' do
253
253
  delete :destroy, id: @resource_export_file.id
254
254
  end
255
255
 
256
- it "redirects to the resource_export_files list" do
256
+ it 'redirects to the resource_export_files list' do
257
257
  delete :destroy, id: @resource_export_file.id
258
258
  expect(response).to redirect_to(resource_export_files_url)
259
259
  end
260
260
  end
261
261
 
262
- describe "When logged in as User" do
262
+ describe 'When logged in as User' do
263
263
  login_fixture_user
264
264
 
265
- it "destroys the requested resource_export_file" do
265
+ it 'destroys the requested resource_export_file' do
266
266
  delete :destroy, id: @resource_export_file.id
267
267
  end
268
268
 
269
- it "should be forbidden" do
269
+ it 'should be forbidden' do
270
270
  delete :destroy, id: @resource_export_file.id
271
271
  expect(response).to be_forbidden
272
272
  end
273
273
  end
274
274
 
275
- describe "When not logged in" do
276
- it "destroys the requested resource_export_file" do
275
+ describe 'When not logged in' do
276
+ it 'destroys the requested resource_export_file' do
277
277
  delete :destroy, id: @resource_export_file.id
278
278
  end
279
279
 
280
- it "should be forbidden" do
280
+ it 'should be forbidden' do
281
281
  delete :destroy, id: @resource_export_file.id
282
282
  expect(response).to redirect_to(new_user_session_url)
283
283
  end
@@ -3,37 +3,37 @@ require 'rails_helper'
3
3
  describe ResourceImportFilesController do
4
4
  fixtures :all
5
5
 
6
- describe "GET index" do
7
- describe "When logged in as Administrator" do
6
+ describe 'GET index' do
7
+ describe 'When logged in as Administrator' do
8
8
  login_fixture_admin
9
9
 
10
- it "assigns all resource_import_files as @resource_import_files" do
10
+ it 'assigns all resource_import_files as @resource_import_files' do
11
11
  get :index
12
12
  expect(assigns(:resource_import_files)).to eq(ResourceImportFile.page(1))
13
13
  end
14
14
  end
15
15
 
16
- describe "When logged in as Librarian" do
16
+ describe 'When logged in as Librarian' do
17
17
  login_fixture_librarian
18
18
 
19
- it "assigns all resource_import_files as @resource_import_files" do
19
+ it 'assigns all resource_import_files as @resource_import_files' do
20
20
  get :index
21
21
  expect(assigns(:resource_import_files)).to eq(ResourceImportFile.page(1))
22
22
  end
23
23
  end
24
24
 
25
- describe "When logged in as User" do
25
+ describe 'When logged in as User' do
26
26
  login_fixture_user
27
27
 
28
- it "assigns empty as @resource_import_files" do
28
+ it 'assigns empty as @resource_import_files' do
29
29
  get :index
30
30
  expect(assigns(:resource_import_files)).to be_nil
31
31
  expect(response).to be_forbidden
32
32
  end
33
33
  end
34
34
 
35
- describe "When not logged in" do
36
- it "assigns empty as @resource_import_files" do
35
+ describe 'When not logged in' do
36
+ it 'assigns empty as @resource_import_files' do
37
37
  get :index
38
38
  expect(assigns(:resource_import_files)).to be_nil
39
39
  expect(response).to redirect_to(new_user_session_url)
@@ -41,79 +41,79 @@ describe ResourceImportFilesController do
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 resource_import_file as @resource_import_file" do
49
- get :show, :id => resource_import_files(:resource_import_file_00003).id
48
+ it 'assigns the requested resource_import_file as @resource_import_file' do
49
+ get :show, id: resource_import_files(:resource_import_file_00003).id
50
50
  expect(assigns(:resource_import_file)).to eq(resource_import_files(:resource_import_file_00003))
51
51
  expect(response).to be_success
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 resource_import_file as @resource_import_file" do
59
- get :show, :id => resource_import_files(:resource_import_file_00003).id
58
+ it 'assigns the requested resource_import_file as @resource_import_file' do
59
+ get :show, id: resource_import_files(:resource_import_file_00003).id
60
60
  expect(assigns(:resource_import_file)).to eq(resource_import_files(:resource_import_file_00003))
61
61
  expect(response).to be_success
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 resource_import_file as @resource_import_file" do
69
- get :show, :id => resource_import_files(:resource_import_file_00003).id
68
+ it 'assigns the requested resource_import_file as @resource_import_file' do
69
+ get :show, id: resource_import_files(:resource_import_file_00003).id
70
70
  expect(assigns(:resource_import_file)).to eq(resource_import_files(:resource_import_file_00003))
71
71
  expect(response).to be_forbidden
72
72
  end
73
73
  end
74
74
 
75
- describe "When not logged in" do
76
- it "assigns the requested resource_import_file as @resource_import_file" do
77
- get :show, :id => resource_import_files(:resource_import_file_00003).id
75
+ describe 'When not logged in' do
76
+ it 'assigns the requested resource_import_file as @resource_import_file' do
77
+ get :show, id: resource_import_files(:resource_import_file_00003).id
78
78
  expect(assigns(:resource_import_file)).to eq(resource_import_files(:resource_import_file_00003))
79
79
  expect(response).to redirect_to(new_user_session_url)
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 resource_import_file as @resource_import_file" do
88
+ it 'assigns the requested resource_import_file as @resource_import_file' do
89
89
  get :new
90
90
  expect(assigns(:resource_import_file)).not_to be_valid
91
91
  expect(response).to be_success
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 "should not assign the requested resource_import_file as @resource_import_file" do
98
+ it 'should not assign the requested resource_import_file as @resource_import_file' do
99
99
  get :new
100
100
  expect(assigns(:resource_import_file)).not_to be_valid
101
101
  expect(response).to be_success
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 resource_import_file as @resource_import_file" do
108
+ it 'should not assign the requested resource_import_file as @resource_import_file' do
109
109
  get :new
110
110
  expect(assigns(:resource_import_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 resource_import_file as @resource_import_file" do
115
+ describe 'When not logged in' do
116
+ it 'should not assign the requested resource_import_file as @resource_import_file' do
117
117
  get :new
118
118
  expect(assigns(:resource_import_file)).to be_nil
119
119
  expect(response).to redirect_to(new_user_session_url)
@@ -121,177 +121,177 @@ describe ResourceImportFilesController do
121
121
  end
122
122
  end
123
123
 
124
- describe "POST create" do
125
- describe "When logged in as Librarian" do
124
+ describe 'POST create' do
125
+ describe 'When logged in as Librarian' do
126
126
  before(:each) do
127
127
  @user = users(:librarian1)
128
128
  sign_in @user
129
129
  end
130
130
 
131
- it "should create resource_import_file" do
132
- post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv'), edit_mode: 'create', default_shelf_id: 1 }
131
+ it 'should create resource_import_file' do
132
+ post :create, resource_import_file: { resource_import: fixture_file_upload('/../../examples/resource_import_file_sample1.tsv', 'text/csv'), edit_mode: 'create', default_shelf_id: 1 }
133
133
  expect(assigns(:resource_import_file)).to be_valid
134
134
  assigns(:resource_import_file).user.username.should eq @user.username
135
135
  expect(response).to redirect_to resource_import_file_url(assigns(:resource_import_file))
136
136
  end
137
137
 
138
- it "should not create resource_import_file without default_shelf_id" do
139
- post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv'), edit_mode: 'create'}
138
+ it 'should not create resource_import_file without default_shelf_id' do
139
+ post :create, resource_import_file: { resource_import: fixture_file_upload('/../../examples/resource_import_file_sample1.tsv', 'text/csv'), edit_mode: 'create' }
140
140
  expect(assigns(:resource_import_file)).not_to be_valid
141
141
  assigns(:resource_import_file).user.username.should eq @user.username
142
142
  expect(response).to be_success
143
143
  end
144
144
  end
145
145
 
146
- describe "When logged in as User" do
146
+ describe 'When logged in as User' do
147
147
  before(:each) do
148
148
  @user = users(:user1)
149
149
  sign_in @user
150
150
  end
151
151
 
152
- it "should be forbidden" do
153
- post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
152
+ it 'should be forbidden' do
153
+ post :create, resource_import_file: { resource_import: fixture_file_upload('/../../examples/resource_import_file_sample1.tsv', 'text/csv') }
154
154
  assigns(:resource_import_file).should be_nil
155
155
  expect(response).to be_forbidden
156
156
  end
157
157
  end
158
158
 
159
- describe "When not logged in" do
160
- it "should be redirected to new session url" do
161
- post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
159
+ describe 'When not logged in' do
160
+ it 'should be redirected to new session url' do
161
+ post :create, resource_import_file: { resource_import: fixture_file_upload('/../../examples/resource_import_file_sample1.tsv', 'text/csv') }
162
162
  assigns(:resource_import_file).should be_nil
163
163
  expect(response).to redirect_to new_user_session_url
164
164
  end
165
165
  end
166
166
  end
167
167
 
168
- describe "GET edit" do
169
- describe "When logged in as Administrator" do
168
+ describe 'GET edit' do
169
+ describe 'When logged in as Administrator' do
170
170
  login_fixture_admin
171
171
 
172
- it "assigns the requested resource_import_file as @resource_import_file" do
172
+ it 'assigns the requested resource_import_file as @resource_import_file' do
173
173
  resource_import_file = resource_import_files(:resource_import_file_00001)
174
- get :edit, :id => resource_import_file.id
174
+ get :edit, id: resource_import_file.id
175
175
  expect(assigns(:resource_import_file)).to eq(resource_import_file)
176
176
  end
177
177
  end
178
178
 
179
- describe "When logged in as Librarian" do
179
+ describe 'When logged in as Librarian' do
180
180
  login_fixture_librarian
181
181
 
182
- it "assigns the requested resource_import_file as @resource_import_file" do
182
+ it 'assigns the requested resource_import_file as @resource_import_file' do
183
183
  resource_import_file = resource_import_files(:resource_import_file_00001)
184
- get :edit, :id => resource_import_file.id
184
+ get :edit, id: resource_import_file.id
185
185
  expect(assigns(:resource_import_file)).to eq(resource_import_file)
186
186
  end
187
187
  end
188
188
 
189
- describe "When logged in as User" do
189
+ describe 'When logged in as User' do
190
190
  login_fixture_user
191
191
 
192
- it "assigns the requested resource_import_file as @resource_import_file" do
192
+ it 'assigns the requested resource_import_file as @resource_import_file' do
193
193
  resource_import_file = resource_import_files(:resource_import_file_00001)
194
- get :edit, :id => resource_import_file.id
194
+ get :edit, id: resource_import_file.id
195
195
  expect(response).to be_forbidden
196
196
  end
197
197
  end
198
198
 
199
- describe "When not logged in" do
200
- it "should not assign the requested resource_import_file as @resource_import_file" do
199
+ describe 'When not logged in' do
200
+ it 'should not assign the requested resource_import_file as @resource_import_file' do
201
201
  resource_import_file = resource_import_files(:resource_import_file_00001)
202
- get :edit, :id => resource_import_file.id
202
+ get :edit, id: resource_import_file.id
203
203
  expect(response).to redirect_to(new_user_session_url)
204
204
  end
205
205
  end
206
206
  end
207
207
 
208
- describe "PUT update" do
209
- describe "When logged in as Administrator" do
208
+ describe 'PUT update' do
209
+ describe 'When logged in as Administrator' do
210
210
  login_fixture_admin
211
211
 
212
- it "should update resource_import_file" do
213
- put :update, :id => resource_import_files(:resource_import_file_00003).id, :resource_import_file => {mode: "update"}
212
+ it 'should update resource_import_file' do
213
+ put :update, id: resource_import_files(:resource_import_file_00003).id, resource_import_file: { mode: 'update' }
214
214
  expect(response).to redirect_to resource_import_file_url(assigns(:resource_import_file))
215
215
  end
216
216
  end
217
217
 
218
- describe "When logged in as Librarian" do
218
+ describe 'When logged in as Librarian' do
219
219
  login_fixture_librarian
220
220
 
221
- it "should update resource_import_file" do
222
- put :update, :id => resource_import_files(:resource_import_file_00003).id, :resource_import_file => {mode: "update"}
221
+ it 'should update resource_import_file' do
222
+ put :update, id: resource_import_files(:resource_import_file_00003).id, resource_import_file: { mode: 'update' }
223
223
  expect(response).to redirect_to resource_import_file_url(assigns(:resource_import_file))
224
224
  end
225
225
  end
226
226
 
227
- describe "When logged in as User" do
227
+ describe 'When logged in as User' do
228
228
  login_fixture_user
229
229
 
230
- it "should not update resource_import_file" do
231
- put :update, :id => resource_import_files(:resource_import_file_00003).id, :resource_import_file => {mode: "update"}
230
+ it 'should not update resource_import_file' do
231
+ put :update, id: resource_import_files(:resource_import_file_00003).id, resource_import_file: { mode: 'update' }
232
232
  expect(response).to be_forbidden
233
233
  end
234
234
  end
235
235
 
236
- describe "When not logged in" do
237
- it "should not update resource_import_file" do
238
- put :update, :id => resource_import_files(:resource_import_file_00003).id, :resource_import_file => {mode: "update"}
236
+ describe 'When not logged in' do
237
+ it 'should not update resource_import_file' do
238
+ put :update, id: resource_import_files(:resource_import_file_00003).id, resource_import_file: { mode: 'update' }
239
239
  expect(response).to redirect_to new_user_session_url
240
240
  end
241
241
  end
242
242
  end
243
243
 
244
- describe "DELETE destroy" do
244
+ describe 'DELETE destroy' do
245
245
  before(:each) do
246
246
  @resource_import_file = resource_import_files(:resource_import_file_00001)
247
247
  end
248
248
 
249
- describe "When logged in as Administrator" do
249
+ describe 'When logged in as Administrator' do
250
250
  login_fixture_admin
251
251
 
252
- it "destroys the requested resource_import_file" do
253
- delete :destroy, :id => @resource_import_file.id
252
+ it 'destroys the requested resource_import_file' do
253
+ delete :destroy, id: @resource_import_file.id
254
254
  end
255
255
 
256
- it "redirects to the resource_import_files list" do
257
- delete :destroy, :id => @resource_import_file.id
256
+ it 'redirects to the resource_import_files list' do
257
+ delete :destroy, id: @resource_import_file.id
258
258
  expect(response).to redirect_to(resource_import_files_url)
259
259
  end
260
260
  end
261
261
 
262
- describe "When logged in as Librarian" do
262
+ describe 'When logged in as Librarian' do
263
263
  login_fixture_librarian
264
264
 
265
- it "destroys the requested resource_import_file" do
266
- delete :destroy, :id => @resource_import_file.id
265
+ it 'destroys the requested resource_import_file' do
266
+ delete :destroy, id: @resource_import_file.id
267
267
  end
268
268
 
269
- it "redirects to the resource_import_files list" do
270
- delete :destroy, :id => @resource_import_file.id
269
+ it 'redirects to the resource_import_files list' do
270
+ delete :destroy, id: @resource_import_file.id
271
271
  expect(response).to redirect_to(resource_import_files_url)
272
272
  end
273
273
  end
274
274
 
275
- describe "When logged in as User" do
275
+ describe 'When logged in as User' do
276
276
  login_fixture_user
277
277
 
278
- it "destroys the requested resource_import_file" do
279
- delete :destroy, :id => @resource_import_file.id
278
+ it 'destroys the requested resource_import_file' do
279
+ delete :destroy, id: @resource_import_file.id
280
280
  end
281
281
 
282
- it "should be forbidden" do
283
- delete :destroy, :id => @resource_import_file.id
282
+ it 'should be forbidden' do
283
+ delete :destroy, id: @resource_import_file.id
284
284
  expect(response).to be_forbidden
285
285
  end
286
286
  end
287
287
 
288
- describe "When not logged in" do
289
- it "destroys the requested resource_import_file" do
290
- delete :destroy, :id => @resource_import_file.id
288
+ describe 'When not logged in' do
289
+ it 'destroys the requested resource_import_file' do
290
+ delete :destroy, id: @resource_import_file.id
291
291
  end
292
292
 
293
- it "should be forbidden" do
294
- delete :destroy, :id => @resource_import_file.id
293
+ it 'should be forbidden' do
294
+ delete :destroy, id: @resource_import_file.id
295
295
  expect(response).to redirect_to(new_user_session_url)
296
296
  end
297
297
  end