ref: refs/heads/master
commit 4d957b18d82f22a687b727978bc320fef5645173
Author: Klaus Kämpf
Date: Tue Jul 21 08:35:37 2009 +0200
Test failure of host creation
---
webclient/test/integration/manage_hosts_test.rb | 28 ++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/webclient/test/integration/manage_hosts_test.rb b/webclient/test/integration/manage_hosts_test.rb
index 02d6501..35720d9 100644
--- a/webclient/test/integration/manage_hosts_test.rb
+++ b/webclient/test/integration/manage_hosts_test.rb
@@ -8,17 +8,42 @@ class ManageHostsTest < ActionController::IntegrationTest
fixtures :accounts
# add a new host
- test "add a new host" do
+ test "add a new host and submit" do
list_hosts
+
+ # push "add" button
get "hosts/new"
assert_response :success
+ # enter form and push "create"
+ post "hosts/create", "host[name]" => "localhost", "host[url]" => "http://localhost:81", "host[description]" => "This is a test"
+
+ # create redirects to index
+ assert_response :redirect
+ follow_redirect!
+
+#FIXME assert flash[:notice]
+ assert_template "hosts/index"
end
# add a new host with a bad url
test "add a new host with a bad url" do
get "/"
assert_response :redirect
+
+ # push "add" button
+ get "hosts/new"
+ assert_response :success
+
+ # enter form and push "create"
+ post "hosts/create", "host[name]" => "localhost", "host[url]" => "foo", "host[description]" => "This has a bad url"
+
+ # create redirects to new and reports error
+ assert_response :redirect
+ follow_redirect!
+
+#FIXME assert flash[:warning]
+ assert_template "hosts/new"
end
@@ -32,5 +57,6 @@ class ManageHostsTest < ActionController::IntegrationTest
assert_response :redirect
follow_redirect!
# now at hosts/index
+ assert_template "hosts/index"
end
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org