enju_circulation 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enju_circulation/version.rb +1 -1
- data/lib/generators/enju_circulation/update/update_generator.rb +1 -1
- data/lib/tasks/enju_circulation_tasks.rake +1 -1
- data/spec/concerns/enju_accept_spec.rb +5 -5
- data/spec/controllers/carrier_type_has_checkout_types_controller_spec.rb +13 -13
- data/spec/controllers/checkout_types_controller_spec.rb +13 -13
- data/spec/controllers/checkouts_controller_spec.rb +1 -1
- data/spec/controllers/circulation_statuses_controller_spec.rb +12 -12
- data/spec/controllers/item_has_use_restrictions_controller_spec.rb +12 -12
- data/spec/controllers/lending_policies_controller_spec.rb +9 -9
- data/spec/controllers/manifestation_checkout_stats_controller_spec.rb +13 -13
- data/spec/controllers/manifestation_reserve_stats_controller_spec.rb +13 -13
- data/spec/controllers/reserves_controller_spec.rb +11 -11
- data/spec/controllers/use_restrictions_controller_spec.rb +12 -12
- data/spec/controllers/user_checkout_stats_controller_spec.rb +13 -13
- data/spec/controllers/user_group_has_checkout_types_controller_spec.rb +12 -12
- data/spec/controllers/user_reserve_stats_controller_spec.rb +13 -13
- data/spec/factories/accept.rb +4 -4
- data/spec/factories/basket.rb +2 -2
- data/spec/factories/carrier_type.rb +1 -1
- data/spec/factories/carrier_type_has_checkout_type.rb +3 -3
- data/spec/factories/checkout.rb +1 -1
- data/spec/factories/checkout_stat.rb +1 -1
- data/spec/factories/checkout_stat_has_manifestation.rb +3 -3
- data/spec/factories/checkout_stat_has_user.rb +3 -3
- data/spec/factories/checkout_type.rb +1 -1
- data/spec/factories/circulation_status.rb +1 -1
- data/spec/factories/item.rb +2 -2
- data/spec/factories/item_has_use_restriction.rb +3 -3
- data/spec/factories/lending_policy.rb +3 -3
- data/spec/factories/manifestation.rb +1 -1
- data/spec/factories/manifestation_checkout_stat.rb +1 -1
- data/spec/factories/manifestation_reserve_stat.rb +1 -1
- data/spec/factories/profile.rb +1 -1
- data/spec/factories/reserve.rb +5 -5
- data/spec/factories/reserve_stat_has_manifestation.rb +3 -3
- data/spec/factories/reserve_stat_has_user.rb +3 -3
- data/spec/factories/use_restriction.rb +1 -1
- data/spec/factories/user.rb +1 -1
- data/spec/factories/user_checkout_stat.rb +1 -1
- data/spec/factories/user_group.rb +1 -1
- data/spec/factories/user_group_has_checkout_type.rb +3 -3
- data/spec/factories/user_reserve_stat.rb +1 -1
- data/spec/models/reserve_spec.rb +9 -9
- data/spec/rails_helper.rb +3 -3
- data/spec/support/controller_macros.rb +3 -3
- data/spec/views/checked_items/new.html.erb_spec.rb +3 -3
- data/spec/views/reserves/index.html.erb_spec.rb +1 -1
- metadata +4 -4
@@ -6,12 +6,12 @@ describe LendingPoliciesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:lending_policy)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:lending_policy)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -51,7 +51,7 @@ describe LendingPoliciesController do
|
|
51
51
|
|
52
52
|
describe 'GET show' do
|
53
53
|
before(:each) do
|
54
|
-
@lending_policy =
|
54
|
+
@lending_policy = FactoryBot.create(:lending_policy)
|
55
55
|
end
|
56
56
|
|
57
57
|
describe 'When logged in as Administrator' do
|
@@ -138,7 +138,7 @@ describe LendingPoliciesController do
|
|
138
138
|
login_fixture_admin
|
139
139
|
|
140
140
|
it 'assigns the requested lending_policy as @lending_policy' do
|
141
|
-
lending_policy =
|
141
|
+
lending_policy = FactoryBot.create(:lending_policy)
|
142
142
|
get :edit, id: lending_policy.id
|
143
143
|
assigns(:lending_policy).should eq(lending_policy)
|
144
144
|
end
|
@@ -148,7 +148,7 @@ describe LendingPoliciesController do
|
|
148
148
|
login_fixture_librarian
|
149
149
|
|
150
150
|
it 'assigns the requested lending_policy as @lending_policy' do
|
151
|
-
lending_policy =
|
151
|
+
lending_policy = FactoryBot.create(:lending_policy)
|
152
152
|
get :edit, id: lending_policy.id
|
153
153
|
response.should be_forbidden
|
154
154
|
end
|
@@ -158,7 +158,7 @@ describe LendingPoliciesController do
|
|
158
158
|
login_fixture_user
|
159
159
|
|
160
160
|
it 'assigns the requested lending_policy as @lending_policy' do
|
161
|
-
lending_policy =
|
161
|
+
lending_policy = FactoryBot.create(:lending_policy)
|
162
162
|
get :edit, id: lending_policy.id
|
163
163
|
response.should be_forbidden
|
164
164
|
end
|
@@ -166,7 +166,7 @@ describe LendingPoliciesController do
|
|
166
166
|
|
167
167
|
describe 'When not logged in' do
|
168
168
|
it 'should not assign the requested lending_policy as @lending_policy' do
|
169
|
-
lending_policy =
|
169
|
+
lending_policy = FactoryBot.create(:lending_policy)
|
170
170
|
get :edit, id: lending_policy.id
|
171
171
|
response.should redirect_to(new_user_session_url)
|
172
172
|
end
|
@@ -292,7 +292,7 @@ describe LendingPoliciesController do
|
|
292
292
|
|
293
293
|
describe 'PUT update' do
|
294
294
|
before(:each) do
|
295
|
-
@lending_policy =
|
295
|
+
@lending_policy = FactoryBot.create(:lending_policy)
|
296
296
|
@attrs = valid_attributes
|
297
297
|
@invalid_attrs = { item_id: '' }
|
298
298
|
end
|
@@ -388,7 +388,7 @@ describe LendingPoliciesController do
|
|
388
388
|
|
389
389
|
describe 'DELETE destroy' do
|
390
390
|
before(:each) do
|
391
|
-
@lending_policy =
|
391
|
+
@lending_policy = FactoryBot.create(:lending_policy)
|
392
392
|
end
|
393
393
|
|
394
394
|
describe 'When logged in as Administrator' do
|
@@ -5,7 +5,7 @@ describe ManifestationCheckoutStatsController do
|
|
5
5
|
|
6
6
|
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
|
-
|
8
|
+
FactoryBot.create(:manifestation_checkout_stat)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When logged in as Administrator' do
|
@@ -48,7 +48,7 @@ describe ManifestationCheckoutStatsController do
|
|
48
48
|
login_fixture_admin
|
49
49
|
|
50
50
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
51
|
-
manifestation_checkout_stat =
|
51
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
52
52
|
get :show, id: manifestation_checkout_stat.id
|
53
53
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
54
54
|
end
|
@@ -58,7 +58,7 @@ describe ManifestationCheckoutStatsController do
|
|
58
58
|
login_fixture_librarian
|
59
59
|
|
60
60
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
61
|
-
manifestation_checkout_stat =
|
61
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
62
62
|
get :show, id: manifestation_checkout_stat.id
|
63
63
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
64
64
|
end
|
@@ -68,7 +68,7 @@ describe ManifestationCheckoutStatsController do
|
|
68
68
|
login_fixture_user
|
69
69
|
|
70
70
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
71
|
-
manifestation_checkout_stat =
|
71
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
72
72
|
get :show, id: manifestation_checkout_stat.id
|
73
73
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
74
74
|
end
|
@@ -76,7 +76,7 @@ describe ManifestationCheckoutStatsController do
|
|
76
76
|
|
77
77
|
describe 'When not logged in' do
|
78
78
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
79
|
-
manifestation_checkout_stat =
|
79
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
80
80
|
get :show, id: manifestation_checkout_stat.id
|
81
81
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
82
82
|
end
|
@@ -126,7 +126,7 @@ describe ManifestationCheckoutStatsController do
|
|
126
126
|
login_fixture_admin
|
127
127
|
|
128
128
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
129
|
-
manifestation_checkout_stat =
|
129
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
130
130
|
get :edit, id: manifestation_checkout_stat.id
|
131
131
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
132
132
|
end
|
@@ -136,7 +136,7 @@ describe ManifestationCheckoutStatsController do
|
|
136
136
|
login_fixture_librarian
|
137
137
|
|
138
138
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
139
|
-
manifestation_checkout_stat =
|
139
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
140
140
|
get :edit, id: manifestation_checkout_stat.id
|
141
141
|
assigns(:manifestation_checkout_stat).should eq(manifestation_checkout_stat)
|
142
142
|
end
|
@@ -146,7 +146,7 @@ describe ManifestationCheckoutStatsController do
|
|
146
146
|
login_fixture_user
|
147
147
|
|
148
148
|
it 'assigns the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
149
|
-
manifestation_checkout_stat =
|
149
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
150
150
|
get :edit, id: manifestation_checkout_stat.id
|
151
151
|
response.should be_forbidden
|
152
152
|
end
|
@@ -154,7 +154,7 @@ describe ManifestationCheckoutStatsController do
|
|
154
154
|
|
155
155
|
describe 'When not logged in' do
|
156
156
|
it 'should not assign the requested manifestation_checkout_stat as @manifestation_checkout_stat' do
|
157
|
-
manifestation_checkout_stat =
|
157
|
+
manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
158
158
|
get :edit, id: manifestation_checkout_stat.id
|
159
159
|
response.should redirect_to(new_user_session_url)
|
160
160
|
end
|
@@ -163,7 +163,7 @@ describe ManifestationCheckoutStatsController do
|
|
163
163
|
|
164
164
|
describe 'POST create' do
|
165
165
|
before(:each) do
|
166
|
-
@attrs =
|
166
|
+
@attrs = FactoryBot.attributes_for(:manifestation_checkout_stat)
|
167
167
|
@invalid_attrs = { start_date: '' }
|
168
168
|
end
|
169
169
|
|
@@ -282,8 +282,8 @@ describe ManifestationCheckoutStatsController do
|
|
282
282
|
|
283
283
|
describe 'PUT update' do
|
284
284
|
before(:each) do
|
285
|
-
@manifestation_checkout_stat =
|
286
|
-
@attrs =
|
285
|
+
@manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
286
|
+
@attrs = FactoryBot.attributes_for(:manifestation_checkout_stat)
|
287
287
|
@invalid_attrs = { start_date: '' }
|
288
288
|
end
|
289
289
|
|
@@ -383,7 +383,7 @@ describe ManifestationCheckoutStatsController do
|
|
383
383
|
|
384
384
|
describe 'DELETE destroy' do
|
385
385
|
before(:each) do
|
386
|
-
@manifestation_checkout_stat =
|
386
|
+
@manifestation_checkout_stat = FactoryBot.create(:manifestation_checkout_stat)
|
387
387
|
end
|
388
388
|
|
389
389
|
describe 'When logged in as Administrator' do
|
@@ -5,7 +5,7 @@ describe ManifestationReserveStatsController do
|
|
5
5
|
|
6
6
|
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
|
-
|
8
|
+
FactoryBot.create(:manifestation_reserve_stat)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When logged in as Administrator' do
|
@@ -48,7 +48,7 @@ describe ManifestationReserveStatsController do
|
|
48
48
|
login_fixture_admin
|
49
49
|
|
50
50
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
51
|
-
manifestation_reserve_stat =
|
51
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
52
52
|
get :show, id: manifestation_reserve_stat.id
|
53
53
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
54
54
|
end
|
@@ -58,7 +58,7 @@ describe ManifestationReserveStatsController do
|
|
58
58
|
login_fixture_librarian
|
59
59
|
|
60
60
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
61
|
-
manifestation_reserve_stat =
|
61
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
62
62
|
get :show, id: manifestation_reserve_stat.id
|
63
63
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
64
64
|
end
|
@@ -68,7 +68,7 @@ describe ManifestationReserveStatsController do
|
|
68
68
|
login_fixture_user
|
69
69
|
|
70
70
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
71
|
-
manifestation_reserve_stat =
|
71
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
72
72
|
get :show, id: manifestation_reserve_stat.id
|
73
73
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
74
74
|
end
|
@@ -76,7 +76,7 @@ describe ManifestationReserveStatsController do
|
|
76
76
|
|
77
77
|
describe 'When not logged in' do
|
78
78
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
79
|
-
manifestation_reserve_stat =
|
79
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
80
80
|
get :show, id: manifestation_reserve_stat.id
|
81
81
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
82
82
|
end
|
@@ -126,7 +126,7 @@ describe ManifestationReserveStatsController do
|
|
126
126
|
login_fixture_admin
|
127
127
|
|
128
128
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
129
|
-
manifestation_reserve_stat =
|
129
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
130
130
|
get :edit, id: manifestation_reserve_stat.id
|
131
131
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
132
132
|
end
|
@@ -136,7 +136,7 @@ describe ManifestationReserveStatsController do
|
|
136
136
|
login_fixture_librarian
|
137
137
|
|
138
138
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
139
|
-
manifestation_reserve_stat =
|
139
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
140
140
|
get :edit, id: manifestation_reserve_stat.id
|
141
141
|
assigns(:manifestation_reserve_stat).should eq(manifestation_reserve_stat)
|
142
142
|
end
|
@@ -146,7 +146,7 @@ describe ManifestationReserveStatsController do
|
|
146
146
|
login_fixture_user
|
147
147
|
|
148
148
|
it 'assigns the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
149
|
-
manifestation_reserve_stat =
|
149
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
150
150
|
get :edit, id: manifestation_reserve_stat.id
|
151
151
|
response.should be_forbidden
|
152
152
|
end
|
@@ -154,7 +154,7 @@ describe ManifestationReserveStatsController do
|
|
154
154
|
|
155
155
|
describe 'When not logged in' do
|
156
156
|
it 'should not assign the requested manifestation_reserve_stat as @manifestation_reserve_stat' do
|
157
|
-
manifestation_reserve_stat =
|
157
|
+
manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
158
158
|
get :edit, id: manifestation_reserve_stat.id
|
159
159
|
response.should redirect_to(new_user_session_url)
|
160
160
|
end
|
@@ -163,7 +163,7 @@ describe ManifestationReserveStatsController do
|
|
163
163
|
|
164
164
|
describe 'POST create' do
|
165
165
|
before(:each) do
|
166
|
-
@attrs =
|
166
|
+
@attrs = FactoryBot.attributes_for(:manifestation_reserve_stat)
|
167
167
|
@invalid_attrs = { start_date: '' }
|
168
168
|
end
|
169
169
|
|
@@ -280,8 +280,8 @@ describe ManifestationReserveStatsController do
|
|
280
280
|
|
281
281
|
describe 'PUT update' do
|
282
282
|
before(:each) do
|
283
|
-
@manifestation_reserve_stat =
|
284
|
-
@attrs =
|
283
|
+
@manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
284
|
+
@attrs = FactoryBot.attributes_for(:manifestation_reserve_stat)
|
285
285
|
@invalid_attrs = { start_date: '' }
|
286
286
|
end
|
287
287
|
|
@@ -381,7 +381,7 @@ describe ManifestationReserveStatsController do
|
|
381
381
|
|
382
382
|
describe 'DELETE destroy' do
|
383
383
|
before(:each) do
|
384
|
-
@manifestation_reserve_stat =
|
384
|
+
@manifestation_reserve_stat = FactoryBot.create(:manifestation_reserve_stat)
|
385
385
|
end
|
386
386
|
|
387
387
|
describe 'When logged in as Administrator' do
|
@@ -143,7 +143,7 @@ describe ReservesController do
|
|
143
143
|
login_fixture_admin
|
144
144
|
|
145
145
|
it 'assigns the requested reserve as @reserve' do
|
146
|
-
reserve =
|
146
|
+
reserve = FactoryBot.create(:reserve)
|
147
147
|
get :show, id: reserve.id
|
148
148
|
assigns(:reserve).should eq(reserve)
|
149
149
|
end
|
@@ -158,7 +158,7 @@ describe ReservesController do
|
|
158
158
|
login_fixture_librarian
|
159
159
|
|
160
160
|
it 'assigns the requested reserve as @reserve' do
|
161
|
-
reserve =
|
161
|
+
reserve = FactoryBot.create(:reserve)
|
162
162
|
get :show, id: reserve.id
|
163
163
|
assigns(:reserve).should eq(reserve)
|
164
164
|
end
|
@@ -173,7 +173,7 @@ describe ReservesController do
|
|
173
173
|
login_fixture_user
|
174
174
|
|
175
175
|
it 'assigns the requested reserve as @reserve' do
|
176
|
-
reserve =
|
176
|
+
reserve = FactoryBot.create(:reserve)
|
177
177
|
get :show, id: reserve.id
|
178
178
|
assigns(:reserve).should eq(reserve)
|
179
179
|
end
|
@@ -191,7 +191,7 @@ describe ReservesController do
|
|
191
191
|
|
192
192
|
describe 'When not logged in' do
|
193
193
|
before(:each) do
|
194
|
-
@reserve =
|
194
|
+
@reserve = FactoryBot.create(:reserve)
|
195
195
|
end
|
196
196
|
|
197
197
|
it 'assigns the requested reserve as @reserve' do
|
@@ -282,7 +282,7 @@ describe ReservesController do
|
|
282
282
|
login_fixture_admin
|
283
283
|
|
284
284
|
it 'assigns the requested reserve as @reserve' do
|
285
|
-
reserve =
|
285
|
+
reserve = FactoryBot.create(:reserve)
|
286
286
|
get :edit, id: reserve.id
|
287
287
|
assigns(:reserve).should eq(reserve)
|
288
288
|
end
|
@@ -297,7 +297,7 @@ describe ReservesController do
|
|
297
297
|
login_fixture_librarian
|
298
298
|
|
299
299
|
it 'assigns the requested reserve as @reserve' do
|
300
|
-
reserve =
|
300
|
+
reserve = FactoryBot.create(:reserve)
|
301
301
|
get :edit, id: reserve.id
|
302
302
|
assigns(:reserve).should eq(reserve)
|
303
303
|
end
|
@@ -312,7 +312,7 @@ describe ReservesController do
|
|
312
312
|
login_fixture_user
|
313
313
|
|
314
314
|
it 'assigns the requested reserve as @reserve' do
|
315
|
-
reserve =
|
315
|
+
reserve = FactoryBot.create(:reserve)
|
316
316
|
get :edit, id: reserve.id
|
317
317
|
assigns(:reserve).should eq(reserve)
|
318
318
|
end
|
@@ -330,7 +330,7 @@ describe ReservesController do
|
|
330
330
|
|
331
331
|
describe 'When not logged in' do
|
332
332
|
it 'should not assign the requested reserve as @reserve' do
|
333
|
-
reserve =
|
333
|
+
reserve = FactoryBot.create(:reserve)
|
334
334
|
get :edit, id: reserve.id
|
335
335
|
response.should redirect_to(new_user_session_url)
|
336
336
|
end
|
@@ -513,8 +513,8 @@ describe ReservesController do
|
|
513
513
|
|
514
514
|
describe 'PUT update' do
|
515
515
|
before(:each) do
|
516
|
-
@reserve =
|
517
|
-
@attrs =
|
516
|
+
@reserve = FactoryBot.create(:reserve)
|
517
|
+
@attrs = FactoryBot.attributes_for(:reserve)
|
518
518
|
@invalid_attrs = { manifestation_id: 'invalid' }
|
519
519
|
end
|
520
520
|
|
@@ -699,7 +699,7 @@ describe ReservesController do
|
|
699
699
|
|
700
700
|
describe 'DELETE destroy' do
|
701
701
|
before(:each) do
|
702
|
-
@reserve =
|
702
|
+
@reserve = FactoryBot.create(:reserve)
|
703
703
|
end
|
704
704
|
|
705
705
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe UseRestrictionsController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:use_restriction)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:use_restriction)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -56,7 +56,7 @@ describe UseRestrictionsController do
|
|
56
56
|
login_fixture_admin
|
57
57
|
|
58
58
|
it 'assigns the requested use_restriction as @use_restriction' do
|
59
|
-
use_restriction =
|
59
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
60
60
|
get :show, id: use_restriction.id
|
61
61
|
assigns(:use_restriction).should eq(use_restriction)
|
62
62
|
end
|
@@ -66,7 +66,7 @@ describe UseRestrictionsController do
|
|
66
66
|
login_fixture_librarian
|
67
67
|
|
68
68
|
it 'assigns the requested use_restriction as @use_restriction' do
|
69
|
-
use_restriction =
|
69
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
70
70
|
get :show, id: use_restriction.id
|
71
71
|
assigns(:use_restriction).should eq(use_restriction)
|
72
72
|
end
|
@@ -76,7 +76,7 @@ describe UseRestrictionsController do
|
|
76
76
|
login_fixture_user
|
77
77
|
|
78
78
|
it 'assigns the requested use_restriction as @use_restriction' do
|
79
|
-
use_restriction =
|
79
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
80
80
|
get :show, id: use_restriction.id
|
81
81
|
assigns(:use_restriction).should eq(use_restriction)
|
82
82
|
end
|
@@ -84,7 +84,7 @@ describe UseRestrictionsController do
|
|
84
84
|
|
85
85
|
describe 'When not logged in' do
|
86
86
|
it 'assigns the requested use_restriction as @use_restriction' do
|
87
|
-
use_restriction =
|
87
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
88
88
|
get :show, id: use_restriction.id
|
89
89
|
assigns(:use_restriction).should eq(use_restriction)
|
90
90
|
end
|
@@ -136,7 +136,7 @@ describe UseRestrictionsController do
|
|
136
136
|
login_fixture_admin
|
137
137
|
|
138
138
|
it 'assigns the requested use_restriction as @use_restriction' do
|
139
|
-
use_restriction =
|
139
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
140
140
|
get :edit, id: use_restriction.id
|
141
141
|
assigns(:use_restriction).should eq(use_restriction)
|
142
142
|
end
|
@@ -146,7 +146,7 @@ describe UseRestrictionsController do
|
|
146
146
|
login_fixture_librarian
|
147
147
|
|
148
148
|
it 'assigns the requested use_restriction as @use_restriction' do
|
149
|
-
use_restriction =
|
149
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
150
150
|
get :edit, id: use_restriction.id
|
151
151
|
response.should be_forbidden
|
152
152
|
end
|
@@ -156,7 +156,7 @@ describe UseRestrictionsController do
|
|
156
156
|
login_fixture_user
|
157
157
|
|
158
158
|
it 'assigns the requested use_restriction as @use_restriction' do
|
159
|
-
use_restriction =
|
159
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
160
160
|
get :edit, id: use_restriction.id
|
161
161
|
response.should be_forbidden
|
162
162
|
end
|
@@ -164,7 +164,7 @@ describe UseRestrictionsController do
|
|
164
164
|
|
165
165
|
describe 'When not logged in' do
|
166
166
|
it 'should not assign the requested use_restriction as @use_restriction' do
|
167
|
-
use_restriction =
|
167
|
+
use_restriction = FactoryBot.create(:use_restriction)
|
168
168
|
get :edit, id: use_restriction.id
|
169
169
|
response.should redirect_to(new_user_session_url)
|
170
170
|
end
|
@@ -290,7 +290,7 @@ describe UseRestrictionsController do
|
|
290
290
|
|
291
291
|
describe 'PUT update' do
|
292
292
|
before(:each) do
|
293
|
-
@use_restriction =
|
293
|
+
@use_restriction = FactoryBot.create(:use_restriction)
|
294
294
|
@attrs = valid_attributes
|
295
295
|
@invalid_attrs = { display_name: '' }
|
296
296
|
end
|
@@ -391,7 +391,7 @@ describe UseRestrictionsController do
|
|
391
391
|
|
392
392
|
describe 'DELETE destroy' do
|
393
393
|
before(:each) do
|
394
|
-
@use_restriction =
|
394
|
+
@use_restriction = FactoryBot.create(:use_restriction)
|
395
395
|
end
|
396
396
|
|
397
397
|
describe 'When logged in as Administrator' do
|