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
@@ -5,7 +5,7 @@ describe UserCheckoutStatsController do
|
|
5
5
|
|
6
6
|
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
|
-
|
8
|
+
FactoryBot.create(:user_checkout_stat)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When logged in as Administrator' do
|
@@ -50,7 +50,7 @@ describe UserCheckoutStatsController do
|
|
50
50
|
login_fixture_admin
|
51
51
|
|
52
52
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
53
|
-
user_checkout_stat =
|
53
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
54
54
|
get :show, id: user_checkout_stat.id
|
55
55
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
56
56
|
end
|
@@ -60,7 +60,7 @@ describe UserCheckoutStatsController do
|
|
60
60
|
login_fixture_librarian
|
61
61
|
|
62
62
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
63
|
-
user_checkout_stat =
|
63
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
64
64
|
get :show, id: user_checkout_stat.id
|
65
65
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
66
66
|
end
|
@@ -70,7 +70,7 @@ describe UserCheckoutStatsController do
|
|
70
70
|
login_fixture_user
|
71
71
|
|
72
72
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
73
|
-
user_checkout_stat =
|
73
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
74
74
|
get :show, id: user_checkout_stat.id
|
75
75
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
76
76
|
response.should be_forbidden
|
@@ -79,7 +79,7 @@ describe UserCheckoutStatsController do
|
|
79
79
|
|
80
80
|
describe 'When not logged in' do
|
81
81
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
82
|
-
user_checkout_stat =
|
82
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
83
83
|
get :show, id: user_checkout_stat.id
|
84
84
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
85
85
|
response.should redirect_to(new_user_session_url)
|
@@ -130,7 +130,7 @@ describe UserCheckoutStatsController do
|
|
130
130
|
login_fixture_admin
|
131
131
|
|
132
132
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
133
|
-
user_checkout_stat =
|
133
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
134
134
|
get :edit, id: user_checkout_stat.id
|
135
135
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
136
136
|
end
|
@@ -140,7 +140,7 @@ describe UserCheckoutStatsController do
|
|
140
140
|
login_fixture_librarian
|
141
141
|
|
142
142
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
143
|
-
user_checkout_stat =
|
143
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
144
144
|
get :edit, id: user_checkout_stat.id
|
145
145
|
assigns(:user_checkout_stat).should eq(user_checkout_stat)
|
146
146
|
end
|
@@ -150,7 +150,7 @@ describe UserCheckoutStatsController do
|
|
150
150
|
login_fixture_user
|
151
151
|
|
152
152
|
it 'assigns the requested user_checkout_stat as @user_checkout_stat' do
|
153
|
-
user_checkout_stat =
|
153
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
154
154
|
get :edit, id: user_checkout_stat.id
|
155
155
|
response.should be_forbidden
|
156
156
|
end
|
@@ -158,7 +158,7 @@ describe UserCheckoutStatsController do
|
|
158
158
|
|
159
159
|
describe 'When not logged in' do
|
160
160
|
it 'should not assign the requested user_checkout_stat as @user_checkout_stat' do
|
161
|
-
user_checkout_stat =
|
161
|
+
user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
162
162
|
get :edit, id: user_checkout_stat.id
|
163
163
|
response.should redirect_to(new_user_session_url)
|
164
164
|
end
|
@@ -167,7 +167,7 @@ describe UserCheckoutStatsController do
|
|
167
167
|
|
168
168
|
describe 'POST create' do
|
169
169
|
before(:each) do
|
170
|
-
@attrs =
|
170
|
+
@attrs = FactoryBot.attributes_for(:user_checkout_stat)
|
171
171
|
@invalid_attrs = { start_date: '' }
|
172
172
|
end
|
173
173
|
|
@@ -284,8 +284,8 @@ describe UserCheckoutStatsController do
|
|
284
284
|
|
285
285
|
describe 'PUT update' do
|
286
286
|
before(:each) do
|
287
|
-
@user_checkout_stat =
|
288
|
-
@attrs =
|
287
|
+
@user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
288
|
+
@attrs = FactoryBot.attributes_for(:user_checkout_stat)
|
289
289
|
@invalid_attrs = { start_date: '' }
|
290
290
|
end
|
291
291
|
|
@@ -385,7 +385,7 @@ describe UserCheckoutStatsController do
|
|
385
385
|
|
386
386
|
describe 'DELETE destroy' do
|
387
387
|
before(:each) do
|
388
|
-
@user_checkout_stat =
|
388
|
+
@user_checkout_stat = FactoryBot.create(:user_checkout_stat)
|
389
389
|
end
|
390
390
|
|
391
391
|
describe 'When logged in as Administrator' do
|
@@ -46,7 +46,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
46
46
|
login_fixture_admin
|
47
47
|
|
48
48
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
49
|
-
user_group_has_checkout_type =
|
49
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
50
50
|
get :show, id: user_group_has_checkout_type.id
|
51
51
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
52
52
|
end
|
@@ -56,7 +56,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
56
56
|
login_fixture_librarian
|
57
57
|
|
58
58
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
59
|
-
user_group_has_checkout_type =
|
59
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
60
60
|
get :show, id: user_group_has_checkout_type.id
|
61
61
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
62
62
|
end
|
@@ -66,7 +66,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
66
66
|
login_fixture_user
|
67
67
|
|
68
68
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
69
|
-
user_group_has_checkout_type =
|
69
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
70
70
|
get :show, id: user_group_has_checkout_type.id
|
71
71
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
72
72
|
end
|
@@ -74,7 +74,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
74
74
|
|
75
75
|
describe 'When not logged in' do
|
76
76
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
77
|
-
user_group_has_checkout_type =
|
77
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
78
78
|
get :show, id: user_group_has_checkout_type.id
|
79
79
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
80
80
|
end
|
@@ -126,7 +126,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
126
126
|
login_fixture_admin
|
127
127
|
|
128
128
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
129
|
-
user_group_has_checkout_type =
|
129
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
130
130
|
get :edit, id: user_group_has_checkout_type.id
|
131
131
|
assigns(:user_group_has_checkout_type).should eq(user_group_has_checkout_type)
|
132
132
|
end
|
@@ -136,7 +136,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
136
136
|
login_fixture_librarian
|
137
137
|
|
138
138
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
139
|
-
user_group_has_checkout_type =
|
139
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
140
140
|
get :edit, id: user_group_has_checkout_type.id
|
141
141
|
response.should be_forbidden
|
142
142
|
end
|
@@ -146,7 +146,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
146
146
|
login_fixture_user
|
147
147
|
|
148
148
|
it 'assigns the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
149
|
-
user_group_has_checkout_type =
|
149
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
150
150
|
get :edit, id: user_group_has_checkout_type.id
|
151
151
|
response.should be_forbidden
|
152
152
|
end
|
@@ -154,7 +154,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
154
154
|
|
155
155
|
describe 'When not logged in' do
|
156
156
|
it 'should not assign the requested user_group_has_checkout_type as @user_group_has_checkout_type' do
|
157
|
-
user_group_has_checkout_type =
|
157
|
+
user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
158
158
|
get :edit, id: user_group_has_checkout_type.id
|
159
159
|
response.should redirect_to(new_user_session_url)
|
160
160
|
end
|
@@ -163,7 +163,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
163
163
|
|
164
164
|
describe 'POST create' do
|
165
165
|
before(:each) do
|
166
|
-
@attrs =
|
166
|
+
@attrs = FactoryBot.attributes_for(:user_group_has_checkout_type)
|
167
167
|
@invalid_attrs = { user_group_id: '' }
|
168
168
|
end
|
169
169
|
|
@@ -280,8 +280,8 @@ describe UserGroupHasCheckoutTypesController do
|
|
280
280
|
|
281
281
|
describe 'PUT update' do
|
282
282
|
before(:each) do
|
283
|
-
@user_group_has_checkout_type =
|
284
|
-
@attrs =
|
283
|
+
@user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
284
|
+
@attrs = FactoryBot.attributes_for(:user_group_has_checkout_type)
|
285
285
|
@invalid_attrs = { user_group_id: '' }
|
286
286
|
end
|
287
287
|
|
@@ -376,7 +376,7 @@ describe UserGroupHasCheckoutTypesController do
|
|
376
376
|
|
377
377
|
describe 'DELETE destroy' do
|
378
378
|
before(:each) do
|
379
|
-
@user_group_has_checkout_type =
|
379
|
+
@user_group_has_checkout_type = FactoryBot.create(:user_group_has_checkout_type)
|
380
380
|
end
|
381
381
|
|
382
382
|
describe 'When logged in as Administrator' do
|
@@ -5,7 +5,7 @@ describe UserReserveStatsController do
|
|
5
5
|
|
6
6
|
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
|
-
|
8
|
+
FactoryBot.create(:user_reserve_stat)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When logged in as Administrator' do
|
@@ -50,7 +50,7 @@ describe UserReserveStatsController do
|
|
50
50
|
login_fixture_admin
|
51
51
|
|
52
52
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
53
|
-
user_reserve_stat =
|
53
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
54
54
|
get :show, id: user_reserve_stat.id
|
55
55
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
56
56
|
end
|
@@ -60,7 +60,7 @@ describe UserReserveStatsController do
|
|
60
60
|
login_fixture_librarian
|
61
61
|
|
62
62
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
63
|
-
user_reserve_stat =
|
63
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
64
64
|
get :show, id: user_reserve_stat.id
|
65
65
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
66
66
|
end
|
@@ -70,7 +70,7 @@ describe UserReserveStatsController do
|
|
70
70
|
login_fixture_user
|
71
71
|
|
72
72
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
73
|
-
user_reserve_stat =
|
73
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
74
74
|
get :show, id: user_reserve_stat.id
|
75
75
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
76
76
|
response.should be_forbidden
|
@@ -79,7 +79,7 @@ describe UserReserveStatsController do
|
|
79
79
|
|
80
80
|
describe 'When not logged in' do
|
81
81
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
82
|
-
user_reserve_stat =
|
82
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
83
83
|
get :show, id: user_reserve_stat.id
|
84
84
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
85
85
|
response.should redirect_to(new_user_session_url)
|
@@ -130,7 +130,7 @@ describe UserReserveStatsController do
|
|
130
130
|
login_fixture_admin
|
131
131
|
|
132
132
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
133
|
-
user_reserve_stat =
|
133
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
134
134
|
get :edit, id: user_reserve_stat.id
|
135
135
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
136
136
|
end
|
@@ -140,7 +140,7 @@ describe UserReserveStatsController do
|
|
140
140
|
login_fixture_librarian
|
141
141
|
|
142
142
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
143
|
-
user_reserve_stat =
|
143
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
144
144
|
get :edit, id: user_reserve_stat.id
|
145
145
|
assigns(:user_reserve_stat).should eq(user_reserve_stat)
|
146
146
|
end
|
@@ -150,7 +150,7 @@ describe UserReserveStatsController do
|
|
150
150
|
login_fixture_user
|
151
151
|
|
152
152
|
it 'assigns the requested user_reserve_stat as @user_reserve_stat' do
|
153
|
-
user_reserve_stat =
|
153
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
154
154
|
get :edit, id: user_reserve_stat.id
|
155
155
|
response.should be_forbidden
|
156
156
|
end
|
@@ -158,7 +158,7 @@ describe UserReserveStatsController do
|
|
158
158
|
|
159
159
|
describe 'When not logged in' do
|
160
160
|
it 'should not assign the requested user_reserve_stat as @user_reserve_stat' do
|
161
|
-
user_reserve_stat =
|
161
|
+
user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
162
162
|
get :edit, id: user_reserve_stat.id
|
163
163
|
response.should redirect_to(new_user_session_url)
|
164
164
|
end
|
@@ -167,7 +167,7 @@ describe UserReserveStatsController do
|
|
167
167
|
|
168
168
|
describe 'POST create' do
|
169
169
|
before(:each) do
|
170
|
-
@attrs =
|
170
|
+
@attrs = FactoryBot.attributes_for(:user_reserve_stat)
|
171
171
|
@invalid_attrs = { start_date: '' }
|
172
172
|
end
|
173
173
|
|
@@ -284,8 +284,8 @@ describe UserReserveStatsController do
|
|
284
284
|
|
285
285
|
describe 'PUT update' do
|
286
286
|
before(:each) do
|
287
|
-
@user_reserve_stat =
|
288
|
-
@attrs =
|
287
|
+
@user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
288
|
+
@attrs = FactoryBot.attributes_for(:user_reserve_stat)
|
289
289
|
@invalid_attrs = { start_date: '' }
|
290
290
|
end
|
291
291
|
|
@@ -385,7 +385,7 @@ describe UserReserveStatsController do
|
|
385
385
|
|
386
386
|
describe 'DELETE destroy' do
|
387
387
|
before(:each) do
|
388
|
-
@user_reserve_stat =
|
388
|
+
@user_reserve_stat = FactoryBot.create(:user_reserve_stat)
|
389
389
|
end
|
390
390
|
|
391
391
|
describe 'When logged in as Administrator' do
|
data/spec/factories/accept.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
2
|
|
3
|
-
|
3
|
+
FactoryBot.define do
|
4
4
|
factory :accept do
|
5
|
-
basket_id{
|
6
|
-
item_id{
|
7
|
-
librarian_id{
|
5
|
+
basket_id{FactoryBot.create(:basket).id}
|
6
|
+
item_id{FactoryBot.create(:item).id}
|
7
|
+
librarian_id{FactoryBot.create(:librarian).id}
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
data/spec/factories/basket.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :carrier_type_has_checkout_type do |f|
|
3
|
-
f.carrier_type_id{
|
4
|
-
f.checkout_type_id{
|
3
|
+
f.carrier_type_id{FactoryBot.create(:carrier_type).id}
|
4
|
+
f.checkout_type_id{FactoryBot.create(:checkout_type).id}
|
5
5
|
end
|
6
6
|
end
|
data/spec/factories/checkout.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :checkout_stat_has_manifestation do |f|
|
3
|
-
f.manifestation_checkout_stat_id{
|
4
|
-
f.manifestation_id{
|
3
|
+
f.manifestation_checkout_stat_id{FactoryBot.create(:manifestation_checkout_stat).id}
|
4
|
+
f.manifestation_id{FactoryBot.create(:manifestation).id}
|
5
5
|
end
|
6
6
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :checkout_stat_has_user do |f|
|
3
|
-
f.user_checkout_stat_id{
|
4
|
-
f.user_id{
|
3
|
+
f.user_checkout_stat_id{FactoryBot.create(:user_checkout_stat).id}
|
4
|
+
f.user_id{FactoryBot.create(:user).id}
|
5
5
|
end
|
6
6
|
end
|
data/spec/factories/item.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :item do |f|
|
3
3
|
f.sequence(:item_identifier){|n| "item_#{n}"}
|
4
4
|
f.circulation_status_id{CirculationStatus.find(1).id} if defined?(EnjuCircuation)
|
5
|
-
f.manifestation_id{
|
5
|
+
f.manifestation_id{FactoryBot.create(:manifestation).id}
|
6
6
|
end
|
7
7
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :item_has_use_restriction do |f|
|
3
|
-
f.item_id{
|
4
|
-
f.use_restriction_id{
|
3
|
+
f.item_id{FactoryBot.create(:item).id}
|
4
|
+
f.use_restriction_id{FactoryBot.create(:use_restriction).id}
|
5
5
|
end
|
6
6
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :lending_policy do |f|
|
3
|
-
f.user_group_id{
|
4
|
-
f.item_id{
|
3
|
+
f.user_group_id{FactoryBot.create(:user_group).id}
|
4
|
+
f.item_id{FactoryBot.create(:item).id}
|
5
5
|
end
|
6
6
|
end
|