[Jifty-commit] r7328 - jifty/trunk/t/TestApp-Plugin-SetupWizard/t

Jifty commits jifty-commit at lists.jifty.org
Wed Jul 15 07:13:36 EDT 2009


Author: sartak
Date: Wed Jul 15 07:13:36 2009
New Revision: 7328

Modified:
   jifty/trunk/t/TestApp-Plugin-SetupWizard/t/001-basic.t

Log:
Make sure we update the site_config correctly for each step of the process

Modified: jifty/trunk/t/TestApp-Plugin-SetupWizard/t/001-basic.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-SetupWizard/t/001-basic.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-SetupWizard/t/001-basic.t	Wed Jul 15 07:13:36 2009
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 use lib 't/TestApp-Plugin-SetupWizard/lib';
-use TestApp::Plugin::SetupWizard::Test tests => 9;
+use TestApp::Plugin::SetupWizard::Test tests => 14;
 
 my $server = Jifty::Test->make_server;
 
@@ -10,18 +10,53 @@
 my $mech = Jifty::Test::WWW::Mechanize->new();
 
 $mech->get_ok("$URL", "Got the doc root");
-$mech->content_like(qr/This installer will help you configure TestApp-Plugin-SetupWizard/, "got setup wizard on load");
+site_config_is(undef, 'no site config to begin with');
 
+$mech->content_like(qr/This installer will help you configure TestApp-Plugin-SetupWizard/, "got setup wizard on load");
 $mech->click_button(value => "Begin");
-$mech->content_like(qr/choose a database engine/, "step 1: database");
+site_config_is(undef, 'no site config yet');
 
+$mech->content_like(qr/choose a database engine/, "step 1: database");
 $mech->click_button(value => "Next");
-$mech->content_like(qr/web server settings/, "step 2: server");
+site_config_is({
+    framework => {
+        Database => {
+            Database => Jifty->config->framework('Database')->{Database},
+            Driver => 'SQLite',
+        },
+    },
+}, 'Database defaults now written to site_config');
 
+$mech->content_like(qr/web server settings/, "step 2: server");
 $mech->click_button(value => "Next");
-$mech->content_like(qr/finalize your config/, "step 3: finalize");
+site_config_is({
+    framework => {
+        Database => {
+            Database => Jifty->config->framework('Database')->{Database},
+            Driver => 'SQLite',
+        },
+        Web => {
+            BaseURL => 'http://localhost',
+            Port    => Jifty->config->framework('Web')->{Port},
+        },
+    },
+}, 'Web-specific defaults');
 
+$mech->content_like(qr/finalize your config/, "step 3: finalize");
 $mech->click_button(value => "Done!");
+site_config_is({
+    framework => {
+        Database => {
+            Database => Jifty->config->framework('Database')->{Database},
+            Driver => 'SQLite',
+        },
+        Web => {
+            BaseURL => 'http://localhost',
+            Port    => Jifty->config->framework('Web')->{Port},
+        },
+        SetupMode => 0,
+    },
+}, 'SetupMode is done, so it is now 0');
 $mech->content_like(qr/Setup finished. Welcome to TestApp-Plugin-SetupWizard!/, "setup tells us we're finished");
 $mech->content_like(qr/You said you wanted a pony/, "we're on the regular homepage");
 


More information about the Jifty-commit mailing list