Update user fixtures with new entity code

This commit is contained in:
Tom Bloor 2017-08-31 13:18:04 +01:00
parent bd8b1f91a4
commit d4ccd0b7a2
20 changed files with 159 additions and 102 deletions

View file

@ -29,63 +29,93 @@ $schema->resultset('Leaderboard')->populate([
[ 'All Time Count', 'all_time_count' ],
]);
my $user1 = {
my $entity1 = {
customer => {
full_name => 'Test User1',
display_name => 'Test User1',
postcode => 'LA1 1AA',
year_of_birth => 2006,
},
user => {
email => 'test1@example.com',
password => 'abc123',
},
type => "customer",
};
my $user2 = {
my $entity2 = {
customer => {
full_name => 'Test User2',
display_name => 'Test User2',
postcode => 'LA1 1AA',
year_of_birth => 2006,
},
user => {
email => 'test2@example.com',
password => 'abc123',
},
type => "customer",
};
my $user3 = {
my $entity3 = {
customer => {
full_name => 'Test User3',
display_name => 'Test User3',
postcode => 'LA1 1AA',
year_of_birth => 2006,
},
user => {
email => 'test3@example.com',
password => 'abc123',
},
type => "customer",
};
my $user4 = {
my $entity4 = {
customer => {
full_name => 'Test User4',
display_name => 'Test User4',
postcode => 'LA1 1AA',
year_of_birth => 2006,
},
user => {
email => 'test4@example.com',
password => 'abc123',
},
type => "customer",
};
my $org = {
my $entity5 = {
organisation => {
name => 'Test Org',
street_name => 'Test Street',
town => 'Lancaster',
postcode => 'LA1 1AA',
},
user => {
email => 'org@example.com',
password => 'abc123',
},
type => "customer",
};
$schema->resultset('User')->create( $_ )
for ( $user1, $user2, $user3, $user4, $org );
my $entity6 = {
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';

View file

@ -5,20 +5,21 @@ $VAR1 = {
'belongs_to' => {
'fetch' => 0
},
'might_have' => {
'fetch' => 0
},
'sets' => [
{
'class' => 'Leaderboard',
'class' => 'Feedback',
'quantity' => 'all'
},
{
'class' => 'AccountToken',
'quantity' => 'all',
'class' => 'LeaderboardSet'
},
{
'class' => 'Transaction',
'quantity' => 'all'
},
{
'class' => 'LeaderboardValue',
'class' => 'Entity',
'quantity' => 'all'
},
{
@ -26,40 +27,31 @@ $VAR1 = {
'class' => 'SessionToken'
},
{
'class' => 'Administrator',
'class' => 'AccountToken',
'quantity' => 'all'
},
{
'class' => 'LeaderboardSet',
'class' => 'Organisation',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'Feedback'
'class' => 'User'
},
{
'class' => 'PendingOrganisation',
'class' => 'Customer',
'quantity' => 'all'
},
{
'class' => 'User',
'quantity' => 'all'
},
{
'class' => 'Transaction',
'class' => 'Leaderboard',
'quantity' => 'all'
},
{
'quantity' => 'all',
'class' => 'Organisation'
},
{
'quantity' => 'all',
'class' => 'Customer'
},
{
'quantity' => 'all',
'class' => 'PendingTransaction'
'class' => 'LeaderboardValue'
}
],
'might_have' => {
'fetch' => 0
}
]
};

View file

@ -1,5 +1,6 @@
$HASH1 = {
display_name => 'Test User1',
entity_id => 1,
full_name => 'Test User1',
id => 1,
postcode => 'LA1 1AA',

View file

@ -1,5 +1,6 @@
$HASH1 = {
display_name => 'Test User2',
entity_id => 2,
full_name => 'Test User2',
id => 2,
postcode => 'LA1 1AA',

View file

@ -1,5 +1,6 @@
$HASH1 = {
display_name => 'Test User3',
entity_id => 3,
full_name => 'Test User3',
id => 3,
postcode => 'LA1 1AA',

View file

@ -1,5 +1,6 @@
$HASH1 = {
display_name => 'Test User4',
entity_id => 4,
full_name => 'Test User4',
id => 4,
postcode => 'LA1 1AA',

View 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
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 1,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 2,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 3,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 4,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 5,
type => 'customer'
};

View file

@ -0,0 +1,4 @@
$HASH1 = {
id => 6,
type => 'customer'
};

View file

@ -1,10 +1,16 @@
$HASH1 = {
country => undef,
entity_id
=> 5,
id => 1,
name => 'Test Org',
pending => 0,
postcode
=> 'LA1 1AA',
sector => undef,
street_name
=> 'Test Street',
submitted_by_id
=> undef,
town => 'Lancaster'
};

View file

@ -1,11 +1,8 @@
$HASH1 = {
customer_id
=> 1,
email => 'test1@example.com',
entity_id => 1,
id => 1,
join_date
=> '2017-08-25 15:36:11',
organisation_id
=> undef,
password => '$2a$08$yCau6xDkRFZINg80iVvMh.M3JnLq2g.LJ7GMJL5KQvO45pDL.D/Rq'
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$HSuznDeSU1fuONwKhp2/S.TX/X4p4g0dHtz20kVXxprm8hIg5QQma'
};

View file

@ -1,11 +1,8 @@
$HASH1 = {
customer_id
=> 2,
email => 'test2@example.com',
entity_id => 2,
id => 2,
join_date
=> '2017-08-25 15:36:11',
organisation_id
=> undef,
password => '$2a$08$BZAsbHSW8TN/jlL2DFGDoeKFRKzj2dQTBwatxb0p/maefEcWcziom'
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$5XYLWPJvVGuWUvfSWj9cIOg4/tyB4fZ3knzwgw5UnBSKFBFIKOiFC'
};

View file

@ -1,11 +1,8 @@
$HASH1 = {
customer_id
=> 3,
email => 'test3@example.com',
entity_id => 3,
id => 3,
join_date
=> '2017-08-25 15:36:11',
organisation_id
=> undef,
password => '$2a$08$xdkD/OA5izrOX9cvJDa4i..8T3YGmfVSo/G87wDRoGWnQmlC0gxOW'
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$p5VU4leHetEvuz2P3uMfYuuPTkDGg8wsM7QuSVKkXR.s3B9T2JaVW'
};

View file

@ -1,11 +1,8 @@
$HASH1 = {
customer_id
=> 4,
email => 'test4@example.com',
entity_id => 4,
id => 4,
join_date
=> '2017-08-25 15:36:11',
organisation_id
=> undef,
password => '$2a$08$svjdm.Syn3f062pDIN3/ROTUU7W16n0zJFm9/sm3x7pfbMLZFV.5G'
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$fkkTUYA9zvt32iBbN7aOcOnmiHzOkbMEjN31PB9CsitGrE.KF7cAG'
};

View file

@ -1,11 +1,8 @@
$HASH1 = {
customer_id
=> undef,
email => 'org@example.com',
entity_id => 5,
id => 5,
join_date
=> '2017-08-25 15:36:11',
organisation_id
=> 1,
password => '$2a$08$3PkZF7D9FiOq8hgU7cJ6puY86Fkl34bQj6dZeJRXPU8hhJIMZtge2'
is_admin => 0,
join_date => '2017-08-31 12:17:25',
password => '$2a$08$MWC45.w1AnLPNNHiS96ICOHfNlTrIqB0.7OPzy5qB.z0pZB0theo.'
};

View 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'
};