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