[Jifty-commit] jifty branch, master, updated. dd250ec35cb883ef2ea107f294ca998ab3b11138

Jifty commits jifty-commit at lists.jifty.org
Tue Dec 15 16:11:45 EST 2009


The branch, master has been updated
       via  dd250ec35cb883ef2ea107f294ca998ab3b11138 (commit)
      from  f4c392a8e19d4a3a24eb73ed2f248e511230dbd6 (commit)

Summary of changes:
 {bin => t/TestApp-Notifications/bin}/jifty         |    0
 .../etc/config.yml                                 |   41 +++++++++++++------
 .../lib/TestApp/Notifications/Notification.pm      |   11 +++++
 t/TestApp-Notifications/t/encoding.t               |   33 ++++++++++++++++
 4 files changed, 72 insertions(+), 13 deletions(-)
 copy {bin => t/TestApp-Notifications/bin}/jifty (100%)
 copy t/{TestApp-Collection-Select => TestApp-Notifications}/etc/config.yml (65%)
 create mode 100644 t/TestApp-Notifications/lib/TestApp/Notifications/Notification.pm
 create mode 100644 t/TestApp-Notifications/t/encoding.t

- Log -----------------------------------------------------------------
commit dd250ec35cb883ef2ea107f294ca998ab3b11138
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Dec 15 16:11:09 2009 -0500

    TestApp-Notifications
    
        It has some failing tests already, but not the right ones!

diff --git a/t/TestApp-Notifications/bin/jifty b/t/TestApp-Notifications/bin/jifty
new file mode 100755
index 0000000..118d895
--- /dev/null
+++ b/t/TestApp-Notifications/bin/jifty
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+use UNIVERSAL::require;
+
+BEGIN {
+    Jifty::Util->require or die $UNIVERSAL::require::ERROR;
+    my $root = Jifty::Util->app_root(quiet => 1);
+    unshift @INC, "$root/lib" if ($root);
+}
+
+use Jifty;
+use Jifty::Script;
+
+local $SIG{INT} = sub { warn "Stopped\n"; exit; };
+Jifty::Script->dispatch();
diff --git a/t/TestApp-Notifications/etc/config.yml b/t/TestApp-Notifications/etc/config.yml
new file mode 100644
index 0000000..061dd70
--- /dev/null
+++ b/t/TestApp-Notifications/etc/config.yml
@@ -0,0 +1,73 @@
+--- 
+framework: 
+  AdminMode: 1
+  ApplicationClass: TestApp::Notifications
+  ApplicationName: TestApp-Notifications
+  ApplicationUUID: F3F2F2C8-E9BB-11DE-AFD7-6AEE7828A805
+  ConfigFileVersion: 4
+  Database: 
+    AutoUpgrade: 1
+    CheckSchema: 1
+    Database: testapp_notifications
+    Driver: SQLite
+    Host: localhost
+    Password: ''
+    RecordBaseClass: Jifty::DBI::Record::Cachable
+    User: ''
+    Version: 0.0.1
+  DevelMode: 1
+  L10N: 
+    PoDir: share/po
+  LogLevel: INFO
+  Mailer: Sendmail
+  MailerArgs: []
+
+  Plugins: 
+    - 
+      AdminUI: {}
+
+    - 
+      CompressedCSSandJS: {}
+
+    - 
+      ErrorTemplates: {}
+
+    - 
+      Halo: {}
+
+    - 
+      LetMe: {}
+
+    - 
+      OnlineDocs: {}
+
+    - 
+      REST: {}
+
+    - 
+      SkeletonApp: {}
+
+  PubSub: 
+    Backend: Memcached
+    Enable: ~
+  SkipAccessControl: 0
+  TemplateClass: TestApp::Notifications::View
+  View: 
+    Handlers: 
+      - Jifty::View::Static::Handler
+      - Jifty::View::Declare::Handler
+      - Jifty::View::Mason::Handler
+  Web: 
+    BaseURL: http://localhost
+    DataDir: var/mason
+    Globals: []
+
+    MasonConfig: 
+      autoflush: 0
+      default_escape_flags: h
+      error_format: text
+      error_mode: fatal
+    Port: 8888
+    ServeStaticFiles: 1
+    StaticRoot: share/web/static
+    TemplateRoot: share/web/templates
diff --git a/t/TestApp-Notifications/lib/TestApp/Notifications/Notification.pm b/t/TestApp-Notifications/lib/TestApp/Notifications/Notification.pm
new file mode 100644
index 0000000..4c8d69c
--- /dev/null
+++ b/t/TestApp-Notifications/lib/TestApp/Notifications/Notification.pm
@@ -0,0 +1,11 @@
+package TestApp::Notifications::Notification;
+use base 'Jifty::Notification';
+use strict;
+use warnings;
+
+sub subject { 'testapp-notifications' }
+sub from { 'notifications at localhost' }
+sub recipients { 'recipient at localhost' }
+
+1;
+
diff --git a/t/TestApp-Notifications/t/encoding.t b/t/TestApp-Notifications/t/encoding.t
new file mode 100644
index 0000000..262ff1e
--- /dev/null
+++ b/t/TestApp-Notifications/t/encoding.t
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+
+use Jifty::Test::Dist tests => 4;
+use TestApp::Notifications::Notification;
+
+sub send_and_receive {
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+    my $body = shift;
+
+    Jifty::Test->setup_mailbox;
+
+    my $notification = TestApp::Notifications::Notification->new;
+    $notification->body($body);
+
+    $notification->send_one_message;
+
+    my @emails = Jifty::Test->messages;
+    Jifty::Test->teardown_mailbox;
+
+    is(scalar @emails, 1, "Sent one notification email");
+    return $emails[0]->body;
+}
+
+my $body = send_and_receive("Simple Latin-1");
+is($body, "Simple Latin-1");
+
+# XXX: should this be "All L\N{LATIN SMALL LETTER E WITH ACUTE}on's fault"
+$body = send_and_receive("All L\x{c3}\x{a9}on's fault");
+
+is($body, "All L\x{c3}\x{a9}on's fault", "proper encoding");
+

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list