## Test Discard changes
{
- ok my $artist = $replicated->schema->resultset('Artist')->find(2)
- => 'got an artist to test discard changes';
+ ok my $artist = $replicated->schema->resultset('Artist')->find(2)
+ => 'got an artist to test discard changes';
- is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}";
+ is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}";
- ok $artist->get_from_storage({force_pool=>'master'})
- => 'properly called get_from_storage against master (manual attrs)';
+ ok $artist->get_from_storage({force_pool=>'master'})
+ => 'properly discard changes';
- is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
- ok $artist->discard_changes({force_pool=>'master'})
- => 'properly called discard_changes against master (manual attrs)';
++ ok $artist->discard_changes({force_pool=>'master'})
++ => 'properly called discard_changes against master (manual attrs)';
+
- is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
++ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
- ok $artist->discard_changes()
- => 'properly called discard_changes against master (default attrs)';
++ ok $artist->discard_changes()
++ => 'properly called discard_changes against master (default attrs)';
+
- is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
++ is $debug{storage_type}, 'MASTER', "got last query from a master: $debug{dsn}";
+
- ok $artist->discard_changes({force_pool=>$replicant_names[0]})
- => 'properly able to override the default attributes';
++ ok $artist->discard_changes({force_pool=>$replicant_names[0]})
++ => 'properly able to override the default attributes';
+
- is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}"
++ is $debug{storage_type}, 'REPLICANT', "got last query from a replicant: $debug{dsn}"
}
## Test some edge cases, like trying to do a transaction inside a transaction, etc