aboutsummaryrefslogtreecommitdiffstats
path: root/t/roles
diff options
context:
space:
mode:
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;