File: proxy-resultset-update.t

package info (click to toggle)
libdbix-class-helpers-perl 2.023007-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 792 kB
  • ctags: 294
  • sloc: perl: 3,872; sql: 161; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 606 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!perl

use strict;
use warnings;

use lib 't/lib';
use Test::More;
use Test::Deep;

use TestSchema;
my $schema = TestSchema->deploy_or_connect();
$schema->prepopulate;

$schema->resultset('Bloaty')->search({ id => 1000 })->delete;
my $row = $schema->resultset('Bloaty')->create({
   id => 1000,
   name => 'woo',
   literature => 'bored',
   your_mom => 'hyuug',
});

$row->name('woot');

$row->update({ literature => 'exciting' });

cmp_deeply(
   [{
      name => 'woot',
      literature => 'exciting',
   }],
   \@TestSchema::ResultSet::Bloaty::stuff,
   'update correctly proxied',
);

done_testing;