enju_leaf 1.1.0.rc17 → 1.1.0.rc18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/controllers/user_export_files_controller.rb +4 -3
- data/app/controllers/user_groups_controller.rb +5 -1
- data/app/controllers/user_import_files_controller.rb +2 -2
- data/app/models/profile.rb +10 -5
- data/app/models/role.rb +2 -2
- data/app/models/user_export_file.rb +16 -11
- data/app/models/user_export_file_transition.rb +4 -4
- data/app/models/user_group.rb +3 -3
- data/app/models/user_has_role.rb +2 -2
- data/app/models/user_import_file.rb +19 -10
- data/app/models/user_import_file_transition.rb +4 -4
- data/app/models/user_import_result.rb +3 -2
- data/app/views/layouts/application.html.erb +1 -1
- data/app/views/my_accounts/_edit_credential.html.erb +1 -1
- data/app/views/page/_menu.html.erb +2 -2
- data/app/views/page/advanced_search.html.erb +12 -0
- data/app/views/user_export_files/show.html.erb +5 -0
- data/app/workers/user_export_file_queue.rb +1 -1
- data/app/workers/user_import_file_queue.rb +1 -1
- data/config/initializers/redis.rb +3 -0
- data/config/locales/simple_form.ja.yml +1 -1
- data/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +5 -0
- data/lib/enju_leaf.rb +5 -6
- data/lib/enju_leaf/calculate_stat.rb +2 -2
- data/lib/enju_leaf/engine.rb +1 -2
- data/lib/enju_leaf/export_file.rb +2 -2
- data/lib/enju_leaf/helper.rb +8 -9
- data/lib/enju_leaf/import_file.rb +8 -8
- data/lib/enju_leaf/user.rb +15 -15
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +7 -14
- data/lib/generators/enju_leaf/setup/setup_generator.rb +23 -16
- data/spec/controllers/my_accounts_controller_spec.rb +7 -6
- data/spec/controllers/profiles_controller_spec.rb +12 -12
- data/spec/controllers/roles_controller_spec.rb +12 -12
- data/spec/controllers/user_export_files_controller_spec.rb +20 -20
- data/spec/controllers/user_groups_controller_spec.rb +47 -47
- data/spec/controllers/user_import_files_controller_spec.rb +20 -20
- data/spec/controllers/user_import_results_controller_spec.rb +12 -12
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/config/initializers/devise.rb +1 -1
- data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +5 -0
- data/spec/dummy/db/schema.rb +3 -1
- data/spec/factories/user.rb +4 -4
- data/spec/fixtures/library_groups.yml +27 -22
- data/spec/fixtures/profiles.yml +10 -5
- data/spec/fixtures/roles.yml +2 -2
- data/spec/fixtures/user_export_files.yml +8 -9
- data/spec/fixtures/user_groups.yml +3 -3
- data/spec/fixtures/user_has_roles.yml +2 -2
- data/spec/fixtures/user_import_files.yml +10 -8
- data/spec/fixtures/user_import_results.yml +3 -2
- data/spec/models/profile_spec.rb +25 -0
- data/spec/models/role_spec.rb +2 -2
- data/spec/models/user_export_file_spec.rb +8 -9
- data/spec/models/user_group_spec.rb +3 -3
- data/spec/models/user_has_role_spec.rb +2 -2
- data/spec/models/user_import_file_spec.rb +19 -16
- data/spec/models/user_import_result_spec.rb +3 -2
- data/spec/routing/accounts_spec.rb +2 -2
- data/spec/routing/profiles_routing_spec.rb +7 -7
- data/spec/routing/resource_import_files_routing_spec.rb +4 -4
- data/spec/views/profiles/new.html.erb_spec.rb +2 -2
- metadata +33 -33
- data/app/models/setting.rb +0 -4
- data/lib/generators/enju_leaf/setup/templates/config/application.yml +0 -48
- data/spec/dummy/app/models/setting.rb +0 -4
@@ -46,7 +46,7 @@ describe UserExportFilesController do
|
|
46
46
|
login_fixture_admin
|
47
47
|
|
48
48
|
it "assigns the requested user_export_file as @user_export_file" do
|
49
|
-
get :show, :
|
49
|
+
get :show, id: user_export_files(:user_export_file_00003).id
|
50
50
|
assigns(:user_export_file).should eq(user_export_files(:user_export_file_00003))
|
51
51
|
expect(response).to be_success
|
52
52
|
end
|
@@ -56,7 +56,7 @@ describe UserExportFilesController do
|
|
56
56
|
login_fixture_librarian
|
57
57
|
|
58
58
|
it "assigns the requested user_export_file as @user_export_file" do
|
59
|
-
get :show, :
|
59
|
+
get :show, id: user_export_files(:user_export_file_00003).id
|
60
60
|
assigns(:user_export_file).should eq(user_export_files(:user_export_file_00003))
|
61
61
|
expect(response).to be_forbidden
|
62
62
|
end
|
@@ -66,7 +66,7 @@ describe UserExportFilesController do
|
|
66
66
|
login_fixture_user
|
67
67
|
|
68
68
|
it "assigns the requested user_export_file as @user_export_file" do
|
69
|
-
get :show, :
|
69
|
+
get :show, id: user_export_files(:user_export_file_00003).id
|
70
70
|
assigns(:user_export_file).should eq(user_export_files(:user_export_file_00003))
|
71
71
|
expect(response).to be_forbidden
|
72
72
|
end
|
@@ -74,7 +74,7 @@ describe UserExportFilesController do
|
|
74
74
|
|
75
75
|
describe "When not logged in" do
|
76
76
|
it "assigns the requested user_export_file as @user_export_file" do
|
77
|
-
get :show, :
|
77
|
+
get :show, id: user_export_files(:user_export_file_00003).id
|
78
78
|
assigns(:user_export_file).should eq(user_export_files(:user_export_file_00003))
|
79
79
|
expect(response).to redirect_to(new_user_session_url)
|
80
80
|
end
|
@@ -169,7 +169,7 @@ describe UserExportFilesController do
|
|
169
169
|
|
170
170
|
it "assigns the requested user_export_file as @user_export_file" do
|
171
171
|
user_export_file = user_export_files(:user_export_file_00001)
|
172
|
-
get :edit, :
|
172
|
+
get :edit, id: user_export_file.id
|
173
173
|
assigns(:user_export_file).should eq(user_export_file)
|
174
174
|
end
|
175
175
|
end
|
@@ -179,7 +179,7 @@ describe UserExportFilesController do
|
|
179
179
|
|
180
180
|
it "assigns the requested user_export_file as @user_export_file" do
|
181
181
|
user_export_file = user_export_files(:user_export_file_00001)
|
182
|
-
get :edit, :
|
182
|
+
get :edit, id: user_export_file.id
|
183
183
|
expect(response).to be_forbidden
|
184
184
|
end
|
185
185
|
end
|
@@ -189,7 +189,7 @@ describe UserExportFilesController do
|
|
189
189
|
|
190
190
|
it "assigns the requested user_export_file as @user_export_file" do
|
191
191
|
user_export_file = user_export_files(:user_export_file_00001)
|
192
|
-
get :edit, :
|
192
|
+
get :edit, id: user_export_file.id
|
193
193
|
expect(response).to be_forbidden
|
194
194
|
end
|
195
195
|
end
|
@@ -197,7 +197,7 @@ describe UserExportFilesController do
|
|
197
197
|
describe "When not logged in" do
|
198
198
|
it "should not assign the requested user_export_file as @user_export_file" do
|
199
199
|
user_export_file = user_export_files(:user_export_file_00001)
|
200
|
-
get :edit, :
|
200
|
+
get :edit, id: user_export_file.id
|
201
201
|
expect(response).to redirect_to(new_user_session_url)
|
202
202
|
end
|
203
203
|
end
|
@@ -208,7 +208,7 @@ describe UserExportFilesController do
|
|
208
208
|
login_fixture_admin
|
209
209
|
|
210
210
|
it "should update user_export_file" do
|
211
|
-
put :update, :
|
211
|
+
put :update, id: user_export_files(:user_export_file_00003).id, :user_export_file => {mode: 'export'}
|
212
212
|
expect(response).to redirect_to user_export_file_url(assigns(:user_export_file))
|
213
213
|
end
|
214
214
|
end
|
@@ -217,7 +217,7 @@ describe UserExportFilesController do
|
|
217
217
|
login_fixture_librarian
|
218
218
|
|
219
219
|
it "should update user_export_file" do
|
220
|
-
put :update, :
|
220
|
+
put :update, id: user_export_files(:user_export_file_00003).id, :user_export_file => {mode: 'export'}
|
221
221
|
expect(response).to be_forbidden
|
222
222
|
end
|
223
223
|
end
|
@@ -226,14 +226,14 @@ describe UserExportFilesController do
|
|
226
226
|
login_fixture_user
|
227
227
|
|
228
228
|
it "should not update user_export_file" do
|
229
|
-
put :update, :
|
229
|
+
put :update, id: user_export_files(:user_export_file_00003).id, :user_export_file => {mode: 'export'}
|
230
230
|
expect(response).to be_forbidden
|
231
231
|
end
|
232
232
|
end
|
233
233
|
|
234
234
|
describe "When not logged in" do
|
235
235
|
it "should not update user_export_file" do
|
236
|
-
put :update, :
|
236
|
+
put :update, id: user_export_files(:user_export_file_00003).id, :user_export_file => {mode: 'export'}
|
237
237
|
expect(response).to redirect_to new_user_session_url
|
238
238
|
end
|
239
239
|
end
|
@@ -248,11 +248,11 @@ describe UserExportFilesController do
|
|
248
248
|
login_fixture_admin
|
249
249
|
|
250
250
|
it "destroys the requested user_export_file" do
|
251
|
-
delete :destroy, :
|
251
|
+
delete :destroy, id: @user_export_file.id
|
252
252
|
end
|
253
253
|
|
254
254
|
it "redirects to the user_export_files list" do
|
255
|
-
delete :destroy, :
|
255
|
+
delete :destroy, id: @user_export_file.id
|
256
256
|
expect(response).to redirect_to(user_export_files_url)
|
257
257
|
end
|
258
258
|
end
|
@@ -261,11 +261,11 @@ describe UserExportFilesController do
|
|
261
261
|
login_fixture_librarian
|
262
262
|
|
263
263
|
it "destroys the requested user_export_file" do
|
264
|
-
delete :destroy, :
|
264
|
+
delete :destroy, id: @user_export_file.id
|
265
265
|
end
|
266
266
|
|
267
267
|
it "should be forbidden" do
|
268
|
-
delete :destroy, :
|
268
|
+
delete :destroy, id: @user_export_file.id
|
269
269
|
expect(response).to be_forbidden
|
270
270
|
end
|
271
271
|
end
|
@@ -274,22 +274,22 @@ describe UserExportFilesController do
|
|
274
274
|
login_fixture_user
|
275
275
|
|
276
276
|
it "destroys the requested user_export_file" do
|
277
|
-
delete :destroy, :
|
277
|
+
delete :destroy, id: @user_export_file.id
|
278
278
|
end
|
279
279
|
|
280
280
|
it "should be forbidden" do
|
281
|
-
delete :destroy, :
|
281
|
+
delete :destroy, id: @user_export_file.id
|
282
282
|
expect(response).to be_forbidden
|
283
283
|
end
|
284
284
|
end
|
285
285
|
|
286
286
|
describe "When not logged in" do
|
287
287
|
it "destroys the requested user_export_file" do
|
288
|
-
delete :destroy, :
|
288
|
+
delete :destroy, id: @user_export_file.id
|
289
289
|
end
|
290
290
|
|
291
291
|
it "should be forbidden" do
|
292
|
-
delete :destroy, :
|
292
|
+
delete :destroy, id: @user_export_file.id
|
293
293
|
expect(response).to redirect_to(new_user_session_url)
|
294
294
|
end
|
295
295
|
end
|
@@ -53,7 +53,7 @@ describe UserGroupsController do
|
|
53
53
|
|
54
54
|
it "assigns the requested user_group as @user_group" do
|
55
55
|
user_group = FactoryGirl.create(:user_group)
|
56
|
-
get :show, :
|
56
|
+
get :show, id: user_group.id
|
57
57
|
assigns(:user_group).should eq(user_group)
|
58
58
|
end
|
59
59
|
end
|
@@ -63,7 +63,7 @@ describe UserGroupsController do
|
|
63
63
|
|
64
64
|
it "assigns the requested user_group as @user_group" do
|
65
65
|
user_group = FactoryGirl.create(:user_group)
|
66
|
-
get :show, :
|
66
|
+
get :show, id: user_group.id
|
67
67
|
assigns(:user_group).should eq(user_group)
|
68
68
|
end
|
69
69
|
end
|
@@ -73,7 +73,7 @@ describe UserGroupsController do
|
|
73
73
|
|
74
74
|
it "assigns the requested user_group as @user_group" do
|
75
75
|
user_group = FactoryGirl.create(:user_group)
|
76
|
-
get :show, :
|
76
|
+
get :show, id: user_group.id
|
77
77
|
assigns(:user_group).should eq(user_group)
|
78
78
|
end
|
79
79
|
end
|
@@ -81,7 +81,7 @@ describe UserGroupsController do
|
|
81
81
|
describe "When not logged in" do
|
82
82
|
it "assigns the requested user_group as @user_group" do
|
83
83
|
user_group = FactoryGirl.create(:user_group)
|
84
|
-
get :show, :
|
84
|
+
get :show, id: user_group.id
|
85
85
|
assigns(:user_group).should eq(user_group)
|
86
86
|
end
|
87
87
|
end
|
@@ -133,7 +133,7 @@ describe UserGroupsController do
|
|
133
133
|
|
134
134
|
it "assigns the requested user_group as @user_group" do
|
135
135
|
user_group = FactoryGirl.create(:user_group)
|
136
|
-
get :edit, :
|
136
|
+
get :edit, id: user_group.id
|
137
137
|
assigns(:user_group).should eq(user_group)
|
138
138
|
end
|
139
139
|
end
|
@@ -143,7 +143,7 @@ describe UserGroupsController do
|
|
143
143
|
|
144
144
|
it "assigns the requested user_group as @user_group" do
|
145
145
|
user_group = FactoryGirl.create(:user_group)
|
146
|
-
get :edit, :
|
146
|
+
get :edit, id: user_group.id
|
147
147
|
expect(response).to be_forbidden
|
148
148
|
end
|
149
149
|
end
|
@@ -153,7 +153,7 @@ describe UserGroupsController do
|
|
153
153
|
|
154
154
|
it "assigns the requested user_group as @user_group" do
|
155
155
|
user_group = FactoryGirl.create(:user_group)
|
156
|
-
get :edit, :
|
156
|
+
get :edit, id: user_group.id
|
157
157
|
expect(response).to be_forbidden
|
158
158
|
end
|
159
159
|
end
|
@@ -161,7 +161,7 @@ describe UserGroupsController do
|
|
161
161
|
describe "When not logged in" do
|
162
162
|
it "should not assign the requested user_group as @user_group" do
|
163
163
|
user_group = FactoryGirl.create(:user_group)
|
164
|
-
get :edit, :
|
164
|
+
get :edit, id: user_group.id
|
165
165
|
expect(response).to redirect_to(new_user_session_url)
|
166
166
|
end
|
167
167
|
end
|
@@ -170,7 +170,7 @@ describe UserGroupsController do
|
|
170
170
|
describe "POST create" do
|
171
171
|
before(:each) do
|
172
172
|
@attrs = valid_attributes
|
173
|
-
@invalid_attrs = {:
|
173
|
+
@invalid_attrs = {name: ''}
|
174
174
|
end
|
175
175
|
|
176
176
|
describe "When logged in as Administrator" do
|
@@ -178,24 +178,24 @@ describe UserGroupsController do
|
|
178
178
|
|
179
179
|
describe "with valid params" do
|
180
180
|
it "assigns a newly created user_group as @user_group" do
|
181
|
-
post :create, :
|
181
|
+
post :create, user_group: @attrs
|
182
182
|
assigns(:user_group).should be_valid
|
183
183
|
end
|
184
184
|
|
185
185
|
it "redirects to the created patron" do
|
186
|
-
post :create, :
|
186
|
+
post :create, user_group: @attrs
|
187
187
|
expect(response).to redirect_to(assigns(:user_group))
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
191
|
describe "with invalid params" do
|
192
192
|
it "assigns a newly created but unsaved user_group as @user_group" do
|
193
|
-
post :create, :
|
193
|
+
post :create, user_group: @invalid_attrs
|
194
194
|
assigns(:user_group).should_not be_valid
|
195
195
|
end
|
196
196
|
|
197
197
|
it "re-renders the 'new' template" do
|
198
|
-
post :create, :
|
198
|
+
post :create, user_group: @invalid_attrs
|
199
199
|
expect(response).to render_template("new")
|
200
200
|
end
|
201
201
|
end
|
@@ -206,24 +206,24 @@ describe UserGroupsController do
|
|
206
206
|
|
207
207
|
describe "with valid params" do
|
208
208
|
it "assigns a newly created user_group as @user_group" do
|
209
|
-
post :create, :
|
209
|
+
post :create, user_group: @attrs
|
210
210
|
assigns(:user_group).should be_valid
|
211
211
|
end
|
212
212
|
|
213
213
|
it "should be forbidden" do
|
214
|
-
post :create, :
|
214
|
+
post :create, user_group: @attrs
|
215
215
|
expect(response).to be_forbidden
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
219
219
|
describe "with invalid params" do
|
220
220
|
it "assigns a newly created but unsaved user_group as @user_group" do
|
221
|
-
post :create, :
|
221
|
+
post :create, user_group: @invalid_attrs
|
222
222
|
assigns(:user_group).should_not be_valid
|
223
223
|
end
|
224
224
|
|
225
225
|
it "should be forbidden" do
|
226
|
-
post :create, :
|
226
|
+
post :create, user_group: @invalid_attrs
|
227
227
|
expect(response).to be_forbidden
|
228
228
|
end
|
229
229
|
end
|
@@ -234,24 +234,24 @@ describe UserGroupsController do
|
|
234
234
|
|
235
235
|
describe "with valid params" do
|
236
236
|
it "assigns a newly created user_group as @user_group" do
|
237
|
-
post :create, :
|
237
|
+
post :create, user_group: @attrs
|
238
238
|
assigns(:user_group).should be_valid
|
239
239
|
end
|
240
240
|
|
241
241
|
it "should be forbidden" do
|
242
|
-
post :create, :
|
242
|
+
post :create, user_group: @attrs
|
243
243
|
expect(response).to be_forbidden
|
244
244
|
end
|
245
245
|
end
|
246
246
|
|
247
247
|
describe "with invalid params" do
|
248
248
|
it "assigns a newly created but unsaved user_group as @user_group" do
|
249
|
-
post :create, :
|
249
|
+
post :create, user_group: @invalid_attrs
|
250
250
|
assigns(:user_group).should_not be_valid
|
251
251
|
end
|
252
252
|
|
253
253
|
it "should be forbidden" do
|
254
|
-
post :create, :
|
254
|
+
post :create, user_group: @invalid_attrs
|
255
255
|
expect(response).to be_forbidden
|
256
256
|
end
|
257
257
|
end
|
@@ -260,24 +260,24 @@ describe UserGroupsController do
|
|
260
260
|
describe "When not logged in" do
|
261
261
|
describe "with valid params" do
|
262
262
|
it "assigns a newly created user_group as @user_group" do
|
263
|
-
post :create, :
|
263
|
+
post :create, user_group: @attrs
|
264
264
|
assigns(:user_group).should be_valid
|
265
265
|
end
|
266
266
|
|
267
267
|
it "should be forbidden" do
|
268
|
-
post :create, :
|
268
|
+
post :create, user_group: @attrs
|
269
269
|
expect(response).to redirect_to(new_user_session_url)
|
270
270
|
end
|
271
271
|
end
|
272
272
|
|
273
273
|
describe "with invalid params" do
|
274
274
|
it "assigns a newly created but unsaved user_group as @user_group" do
|
275
|
-
post :create, :
|
275
|
+
post :create, user_group: @invalid_attrs
|
276
276
|
assigns(:user_group).should_not be_valid
|
277
277
|
end
|
278
278
|
|
279
279
|
it "should be forbidden" do
|
280
|
-
post :create, :
|
280
|
+
post :create, user_group: @invalid_attrs
|
281
281
|
expect(response).to redirect_to(new_user_session_url)
|
282
282
|
end
|
283
283
|
end
|
@@ -288,7 +288,7 @@ describe UserGroupsController do
|
|
288
288
|
before(:each) do
|
289
289
|
@user_group = FactoryGirl.create(:user_group)
|
290
290
|
@attrs = valid_attributes
|
291
|
-
@invalid_attrs = {:
|
291
|
+
@invalid_attrs = {name: ''}
|
292
292
|
end
|
293
293
|
|
294
294
|
describe "When logged in as Administrator" do
|
@@ -296,23 +296,23 @@ describe UserGroupsController do
|
|
296
296
|
|
297
297
|
describe "with valid params" do
|
298
298
|
it "updates the requested user_group" do
|
299
|
-
put :update, :
|
299
|
+
put :update, id: @user_group.id, user_group: @attrs
|
300
300
|
end
|
301
301
|
|
302
302
|
it "assigns the requested user_group as @user_group" do
|
303
|
-
put :update, :
|
303
|
+
put :update, id: @user_group.id, user_group: @attrs
|
304
304
|
assigns(:user_group).should eq(@user_group)
|
305
305
|
end
|
306
306
|
|
307
307
|
it "moves its position when specified" do
|
308
|
-
put :update, :
|
308
|
+
put :update, id: @user_group.id, user_group: @attrs, :move => 'lower'
|
309
309
|
expect(response).to redirect_to(user_groups_url)
|
310
310
|
end
|
311
311
|
end
|
312
312
|
|
313
313
|
describe "with invalid params" do
|
314
314
|
it "assigns the requested user_group as @user_group" do
|
315
|
-
put :update, :
|
315
|
+
put :update, id: @user_group.id, user_group: @invalid_attrs
|
316
316
|
expect(response).to render_template("edit")
|
317
317
|
end
|
318
318
|
end
|
@@ -323,11 +323,11 @@ describe UserGroupsController do
|
|
323
323
|
|
324
324
|
describe "with valid params" do
|
325
325
|
it "updates the requested user_group" do
|
326
|
-
put :update, :
|
326
|
+
put :update, id: @user_group.id, user_group: @attrs
|
327
327
|
end
|
328
328
|
|
329
329
|
it "assigns the requested user_group as @user_group" do
|
330
|
-
put :update, :
|
330
|
+
put :update, id: @user_group.id, user_group: @attrs
|
331
331
|
assigns(:user_group).should eq(@user_group)
|
332
332
|
expect(response).to be_forbidden
|
333
333
|
end
|
@@ -335,7 +335,7 @@ describe UserGroupsController do
|
|
335
335
|
|
336
336
|
describe "with invalid params" do
|
337
337
|
it "assigns the requested user_group as @user_group" do
|
338
|
-
put :update, :
|
338
|
+
put :update, id: @user_group.id, user_group: @invalid_attrs
|
339
339
|
expect(response).to be_forbidden
|
340
340
|
end
|
341
341
|
end
|
@@ -346,11 +346,11 @@ describe UserGroupsController do
|
|
346
346
|
|
347
347
|
describe "with valid params" do
|
348
348
|
it "updates the requested user_group" do
|
349
|
-
put :update, :
|
349
|
+
put :update, id: @user_group.id, user_group: @attrs
|
350
350
|
end
|
351
351
|
|
352
352
|
it "assigns the requested user_group as @user_group" do
|
353
|
-
put :update, :
|
353
|
+
put :update, id: @user_group.id, user_group: @attrs
|
354
354
|
assigns(:user_group).should eq(@user_group)
|
355
355
|
expect(response).to be_forbidden
|
356
356
|
end
|
@@ -358,7 +358,7 @@ describe UserGroupsController do
|
|
358
358
|
|
359
359
|
describe "with invalid params" do
|
360
360
|
it "assigns the requested user_group as @user_group" do
|
361
|
-
put :update, :
|
361
|
+
put :update, id: @user_group.id, user_group: @invalid_attrs
|
362
362
|
expect(response).to be_forbidden
|
363
363
|
end
|
364
364
|
end
|
@@ -367,18 +367,18 @@ describe UserGroupsController do
|
|
367
367
|
describe "When not logged in" do
|
368
368
|
describe "with valid params" do
|
369
369
|
it "updates the requested user_group" do
|
370
|
-
put :update, :
|
370
|
+
put :update, id: @user_group.id, user_group: @attrs
|
371
371
|
end
|
372
372
|
|
373
373
|
it "should be forbidden" do
|
374
|
-
put :update, :
|
374
|
+
put :update, id: @user_group.id, user_group: @attrs
|
375
375
|
expect(response).to redirect_to(new_user_session_url)
|
376
376
|
end
|
377
377
|
end
|
378
378
|
|
379
379
|
describe "with invalid params" do
|
380
380
|
it "assigns the requested user_group as @user_group" do
|
381
|
-
put :update, :
|
381
|
+
put :update, id: @user_group.id, user_group: @invalid_attrs
|
382
382
|
expect(response).to redirect_to(new_user_session_url)
|
383
383
|
end
|
384
384
|
end
|
@@ -394,11 +394,11 @@ describe UserGroupsController do
|
|
394
394
|
login_fixture_admin
|
395
395
|
|
396
396
|
it "destroys the requested user_group" do
|
397
|
-
delete :destroy, :
|
397
|
+
delete :destroy, id: @user_group.id
|
398
398
|
end
|
399
399
|
|
400
400
|
it "redirects to the user_groups list" do
|
401
|
-
delete :destroy, :
|
401
|
+
delete :destroy, id: @user_group.id
|
402
402
|
expect(response).to redirect_to(user_groups_url)
|
403
403
|
end
|
404
404
|
end
|
@@ -407,11 +407,11 @@ describe UserGroupsController do
|
|
407
407
|
login_fixture_librarian
|
408
408
|
|
409
409
|
it "destroys the requested user_group" do
|
410
|
-
delete :destroy, :
|
410
|
+
delete :destroy, id: @user_group.id
|
411
411
|
end
|
412
412
|
|
413
413
|
it "should be forbidden" do
|
414
|
-
delete :destroy, :
|
414
|
+
delete :destroy, id: @user_group.id
|
415
415
|
expect(response).to be_forbidden
|
416
416
|
end
|
417
417
|
end
|
@@ -420,22 +420,22 @@ describe UserGroupsController do
|
|
420
420
|
login_fixture_user
|
421
421
|
|
422
422
|
it "destroys the requested user_group" do
|
423
|
-
delete :destroy, :
|
423
|
+
delete :destroy, id: @user_group.id
|
424
424
|
end
|
425
425
|
|
426
426
|
it "should be forbidden" do
|
427
|
-
delete :destroy, :
|
427
|
+
delete :destroy, id: @user_group.id
|
428
428
|
expect(response).to be_forbidden
|
429
429
|
end
|
430
430
|
end
|
431
431
|
|
432
432
|
describe "When not logged in" do
|
433
433
|
it "destroys the requested user_group" do
|
434
|
-
delete :destroy, :
|
434
|
+
delete :destroy, id: @user_group.id
|
435
435
|
end
|
436
436
|
|
437
437
|
it "should be forbidden" do
|
438
|
-
delete :destroy, :
|
438
|
+
delete :destroy, id: @user_group.id
|
439
439
|
expect(response).to redirect_to(new_user_session_url)
|
440
440
|
end
|
441
441
|
end
|