Update user fixtures with new entity code
This commit is contained in:
parent
bd8b1f91a4
commit
d4ccd0b7a2
20 changed files with 159 additions and 102 deletions
|
@ -29,63 +29,93 @@ $schema->resultset('Leaderboard')->populate([
|
||||||
[ 'All Time Count', 'all_time_count' ],
|
[ 'All Time Count', 'all_time_count' ],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
my $user1 = {
|
my $entity1 = {
|
||||||
customer => {
|
customer => {
|
||||||
full_name => 'Test User1',
|
full_name => 'Test User1',
|
||||||
display_name => 'Test User1',
|
display_name => 'Test User1',
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
year_of_birth => 2006,
|
year_of_birth => 2006,
|
||||||
},
|
},
|
||||||
|
user => {
|
||||||
email => 'test1@example.com',
|
email => 'test1@example.com',
|
||||||
password => 'abc123',
|
password => 'abc123',
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
};
|
};
|
||||||
|
|
||||||
my $user2 = {
|
my $entity2 = {
|
||||||
customer => {
|
customer => {
|
||||||
full_name => 'Test User2',
|
full_name => 'Test User2',
|
||||||
display_name => 'Test User2',
|
display_name => 'Test User2',
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
year_of_birth => 2006,
|
year_of_birth => 2006,
|
||||||
},
|
},
|
||||||
|
user => {
|
||||||
email => 'test2@example.com',
|
email => 'test2@example.com',
|
||||||
password => 'abc123',
|
password => 'abc123',
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
};
|
};
|
||||||
|
|
||||||
my $user3 = {
|
my $entity3 = {
|
||||||
customer => {
|
customer => {
|
||||||
full_name => 'Test User3',
|
full_name => 'Test User3',
|
||||||
display_name => 'Test User3',
|
display_name => 'Test User3',
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
year_of_birth => 2006,
|
year_of_birth => 2006,
|
||||||
},
|
},
|
||||||
|
user => {
|
||||||
email => 'test3@example.com',
|
email => 'test3@example.com',
|
||||||
password => 'abc123',
|
password => 'abc123',
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
};
|
};
|
||||||
|
|
||||||
my $user4 = {
|
my $entity4 = {
|
||||||
customer => {
|
customer => {
|
||||||
full_name => 'Test User4',
|
full_name => 'Test User4',
|
||||||
display_name => 'Test User4',
|
display_name => 'Test User4',
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
year_of_birth => 2006,
|
year_of_birth => 2006,
|
||||||
},
|
},
|
||||||
|
user => {
|
||||||
email => 'test4@example.com',
|
email => 'test4@example.com',
|
||||||
password => 'abc123',
|
password => 'abc123',
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
};
|
};
|
||||||
|
|
||||||
my $org = {
|
my $entity5 = {
|
||||||
organisation => {
|
organisation => {
|
||||||
name => 'Test Org',
|
name => 'Test Org',
|
||||||
street_name => 'Test Street',
|
street_name => 'Test Street',
|
||||||
town => 'Lancaster',
|
town => 'Lancaster',
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
},
|
},
|
||||||
|
user => {
|
||||||
email => 'org@example.com',
|
email => 'org@example.com',
|
||||||
password => 'abc123',
|
password => 'abc123',
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
};
|
};
|
||||||
|
|
||||||
$schema->resultset('User')->create( $_ )
|
my $entity6 = {
|
||||||
for ( $user1, $user2, $user3, $user4, $org );
|
customer => {
|
||||||
|
full_name => 'Test Admin',
|
||||||
|
display_name => 'Test Admin',
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006,
|
||||||
|
},
|
||||||
|
user => {
|
||||||
|
email => 'admin@example.com',
|
||||||
|
password => 'abc123',
|
||||||
|
is_admin => \"1",
|
||||||
|
},
|
||||||
|
type => "customer",
|
||||||
|
};
|
||||||
|
|
||||||
|
$schema->resultset('Entity')->create( $_ )
|
||||||
|
for ( $entity1, $entity2, $entity3, $entity4, $entity5, $entity6 );
|
||||||
|
|
||||||
my $data_set = 'users';
|
my $data_set = 'users';
|
||||||
|
|
||||||
|
|
|
@ -5,20 +5,21 @@ $VAR1 = {
|
||||||
'belongs_to' => {
|
'belongs_to' => {
|
||||||
'fetch' => 0
|
'fetch' => 0
|
||||||
},
|
},
|
||||||
'might_have' => {
|
|
||||||
'fetch' => 0
|
|
||||||
},
|
|
||||||
'sets' => [
|
'sets' => [
|
||||||
{
|
{
|
||||||
'class' => 'Leaderboard',
|
'class' => 'Feedback',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'AccountToken',
|
'quantity' => 'all',
|
||||||
|
'class' => 'LeaderboardSet'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'class' => 'Transaction',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'LeaderboardValue',
|
'class' => 'Entity',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -26,40 +27,31 @@ $VAR1 = {
|
||||||
'class' => 'SessionToken'
|
'class' => 'SessionToken'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'Administrator',
|
'class' => 'AccountToken',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'LeaderboardSet',
|
'class' => 'Organisation',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'quantity' => 'all',
|
'quantity' => 'all',
|
||||||
'class' => 'Feedback'
|
'class' => 'User'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'PendingOrganisation',
|
'class' => 'Customer',
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'class' => 'User',
|
'class' => 'Leaderboard',
|
||||||
'quantity' => 'all'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'class' => 'Transaction',
|
|
||||||
'quantity' => 'all'
|
'quantity' => 'all'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'quantity' => 'all',
|
'quantity' => 'all',
|
||||||
'class' => 'Organisation'
|
'class' => 'LeaderboardValue'
|
||||||
},
|
}
|
||||||
{
|
],
|
||||||
'quantity' => 'all',
|
'might_have' => {
|
||||||
'class' => 'Customer'
|
'fetch' => 0
|
||||||
},
|
|
||||||
{
|
|
||||||
'quantity' => 'all',
|
|
||||||
'class' => 'PendingTransaction'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
display_name => 'Test User1',
|
display_name => 'Test User1',
|
||||||
|
entity_id => 1,
|
||||||
full_name => 'Test User1',
|
full_name => 'Test User1',
|
||||||
id => 1,
|
id => 1,
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
display_name => 'Test User2',
|
display_name => 'Test User2',
|
||||||
|
entity_id => 2,
|
||||||
full_name => 'Test User2',
|
full_name => 'Test User2',
|
||||||
id => 2,
|
id => 2,
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
display_name => 'Test User3',
|
display_name => 'Test User3',
|
||||||
|
entity_id => 3,
|
||||||
full_name => 'Test User3',
|
full_name => 'Test User3',
|
||||||
id => 3,
|
id => 3,
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
display_name => 'Test User4',
|
display_name => 'Test User4',
|
||||||
|
entity_id => 4,
|
||||||
full_name => 'Test User4',
|
full_name => 'Test User4',
|
||||||
id => 4,
|
id => 4,
|
||||||
postcode => 'LA1 1AA',
|
postcode => 'LA1 1AA',
|
||||||
|
|
8
t/etc/fixtures/data/users/customers/5.fix
Normal file
8
t/etc/fixtures/data/users/customers/5.fix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
$HASH1 = {
|
||||||
|
display_name => 'Test Admin',
|
||||||
|
entity_id => 6,
|
||||||
|
full_name => 'Test Admin',
|
||||||
|
id => 5,
|
||||||
|
postcode => 'LA1 1AA',
|
||||||
|
year_of_birth => 2006
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/1.fix
Normal file
4
t/etc/fixtures/data/users/entities/1.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 1,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/2.fix
Normal file
4
t/etc/fixtures/data/users/entities/2.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 2,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/3.fix
Normal file
4
t/etc/fixtures/data/users/entities/3.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 3,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/4.fix
Normal file
4
t/etc/fixtures/data/users/entities/4.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 4,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/5.fix
Normal file
4
t/etc/fixtures/data/users/entities/5.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 5,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
4
t/etc/fixtures/data/users/entities/6.fix
Normal file
4
t/etc/fixtures/data/users/entities/6.fix
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
$HASH1 = {
|
||||||
|
id => 6,
|
||||||
|
type => 'customer'
|
||||||
|
};
|
|
@ -1,10 +1,16 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
|
country => undef,
|
||||||
|
entity_id
|
||||||
|
=> 5,
|
||||||
id => 1,
|
id => 1,
|
||||||
name => 'Test Org',
|
name => 'Test Org',
|
||||||
|
pending => 0,
|
||||||
postcode
|
postcode
|
||||||
=> 'LA1 1AA',
|
=> 'LA1 1AA',
|
||||||
sector => undef,
|
sector => undef,
|
||||||
street_name
|
street_name
|
||||||
=> 'Test Street',
|
=> 'Test Street',
|
||||||
|
submitted_by_id
|
||||||
|
=> undef,
|
||||||
town => 'Lancaster'
|
town => 'Lancaster'
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
customer_id
|
|
||||||
=> 1,
|
|
||||||
email => 'test1@example.com',
|
email => 'test1@example.com',
|
||||||
|
entity_id => 1,
|
||||||
id => 1,
|
id => 1,
|
||||||
join_date
|
is_admin => 0,
|
||||||
=> '2017-08-25 15:36:11',
|
join_date => '2017-08-31 12:17:25',
|
||||||
organisation_id
|
password => '$2a$08$HSuznDeSU1fuONwKhp2/S.TX/X4p4g0dHtz20kVXxprm8hIg5QQma'
|
||||||
=> undef,
|
|
||||||
password => '$2a$08$yCau6xDkRFZINg80iVvMh.M3JnLq2g.LJ7GMJL5KQvO45pDL.D/Rq'
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
customer_id
|
|
||||||
=> 2,
|
|
||||||
email => 'test2@example.com',
|
email => 'test2@example.com',
|
||||||
|
entity_id => 2,
|
||||||
id => 2,
|
id => 2,
|
||||||
join_date
|
is_admin => 0,
|
||||||
=> '2017-08-25 15:36:11',
|
join_date => '2017-08-31 12:17:25',
|
||||||
organisation_id
|
password => '$2a$08$5XYLWPJvVGuWUvfSWj9cIOg4/tyB4fZ3knzwgw5UnBSKFBFIKOiFC'
|
||||||
=> undef,
|
|
||||||
password => '$2a$08$BZAsbHSW8TN/jlL2DFGDoeKFRKzj2dQTBwatxb0p/maefEcWcziom'
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
customer_id
|
|
||||||
=> 3,
|
|
||||||
email => 'test3@example.com',
|
email => 'test3@example.com',
|
||||||
|
entity_id => 3,
|
||||||
id => 3,
|
id => 3,
|
||||||
join_date
|
is_admin => 0,
|
||||||
=> '2017-08-25 15:36:11',
|
join_date => '2017-08-31 12:17:25',
|
||||||
organisation_id
|
password => '$2a$08$p5VU4leHetEvuz2P3uMfYuuPTkDGg8wsM7QuSVKkXR.s3B9T2JaVW'
|
||||||
=> undef,
|
|
||||||
password => '$2a$08$xdkD/OA5izrOX9cvJDa4i..8T3YGmfVSo/G87wDRoGWnQmlC0gxOW'
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
customer_id
|
|
||||||
=> 4,
|
|
||||||
email => 'test4@example.com',
|
email => 'test4@example.com',
|
||||||
|
entity_id => 4,
|
||||||
id => 4,
|
id => 4,
|
||||||
join_date
|
is_admin => 0,
|
||||||
=> '2017-08-25 15:36:11',
|
join_date => '2017-08-31 12:17:25',
|
||||||
organisation_id
|
password => '$2a$08$fkkTUYA9zvt32iBbN7aOcOnmiHzOkbMEjN31PB9CsitGrE.KF7cAG'
|
||||||
=> undef,
|
|
||||||
password => '$2a$08$svjdm.Syn3f062pDIN3/ROTUU7W16n0zJFm9/sm3x7pfbMLZFV.5G'
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
$HASH1 = {
|
$HASH1 = {
|
||||||
customer_id
|
|
||||||
=> undef,
|
|
||||||
email => 'org@example.com',
|
email => 'org@example.com',
|
||||||
|
entity_id => 5,
|
||||||
id => 5,
|
id => 5,
|
||||||
join_date
|
is_admin => 0,
|
||||||
=> '2017-08-25 15:36:11',
|
join_date => '2017-08-31 12:17:25',
|
||||||
organisation_id
|
password => '$2a$08$MWC45.w1AnLPNNHiS96ICOHfNlTrIqB0.7OPzy5qB.z0pZB0theo.'
|
||||||
=> 1,
|
|
||||||
password => '$2a$08$3PkZF7D9FiOq8hgU7cJ6puY86Fkl34bQj6dZeJRXPU8hhJIMZtge2'
|
|
||||||
};
|
};
|
||||||
|
|
8
t/etc/fixtures/data/users/users/6.fix
Normal file
8
t/etc/fixtures/data/users/users/6.fix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
$HASH1 = {
|
||||||
|
email => 'admin@example.com',
|
||||||
|
entity_id => 6,
|
||||||
|
id => 6,
|
||||||
|
is_admin => 1,
|
||||||
|
join_date => '2017-08-31 12:17:25',
|
||||||
|
password => '$2a$08$1sPcPB9GnoNgzhBAk2bHSOqEmv6.Y6YLrAa2DJ6TR2WefzTYZQ92G'
|
||||||
|
};
|
Reference in a new issue