aboutsummaryrefslogtreecommitdiffstats
path: root/t/roles
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-07-16 21:52:54 +0100
committerStruan Donald <struan@exo.org.uk>2017-08-09 17:14:49 +0100
commitfe4153e367bcbb74eebed9c8ac0126d94709506c (patch)
tree692cb8c92ccbc894809b89f63d17c028fd026745 /t/roles
parente00c75d7f19bc45879c254ea77dce32df825f3a7 (diff)
Set up translatable body name.
Diffstat (limited to 't/roles')
-rw-r--r--t/roles/translatable.t22
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;