diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-07-16 21:52:54 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-08-09 17:14:49 +0100 |
commit | fe4153e367bcbb74eebed9c8ac0126d94709506c (patch) | |
tree | 692cb8c92ccbc894809b89f63d17c028fd026745 /t/roles | |
parent | e00c75d7f19bc45879c254ea77dce32df825f3a7 (diff) |
Set up translatable body name.
Diffstat (limited to 't/roles')
-rw-r--r-- | t/roles/translatable.t | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/roles/translatable.t b/t/roles/translatable.t new file mode 100644 index 000000000..a33b2d9d0 --- /dev/null +++ b/t/roles/translatable.t @@ -0,0 +1,22 @@ +use FixMyStreet::TestMech; +my $mech = FixMyStreet::TestMech->new; + +my $body = FixMyStreet::DB->resultset("Body")->create({ name => 'Dunkirk' }); + +FixMyStreet::DB->resultset("Translation")->create({ + lang => "fr", + tbl => "body", + object_id => $body->id, + col => "name", + msgstr => "Dunkerque", +}); + +is $body->name, "Dunkirk"; + +FixMyStreet::DB->schema->lang("fr"); +is $body->name, "Dunkerque"; + +FixMyStreet::DB->schema->lang("de"); +is $body->name, "Dunkirk"; + +done_testing; |