Clarified socket helper, added a selenium test

This commit is contained in:
Raphael 2010-07-30 12:40:02 -07:00
parent 6fe00982f2
commit c95ceecf9e
3 changed files with 86 additions and 3 deletions

View file

@ -18,11 +18,13 @@ module SocketsHelper
puts e.message
raise e
end
action_hash = {:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object)}
if object.is_a? Photo
{:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object), :photo_hash => object.thumb_hash }.to_json
else
{:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object)}.to_json
action_hash[:photo_hash] = object.thumb_hash
end
action_hash.to_json
end

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>Test Suite</title>
</head>
<body>
<table id="suiteTable" cellpadding="1" cellspacing="1" border="1" class="selenium"><tbody>
<tr><td><b>Test Suite</b></td></tr>
<tr><td><a href="../../../Diaspora_selenium">Diaspora_selenium</a></td></tr>
</tbody></table>
</body>
</html>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://tom.joindiaspora.com/" />
<title>post_and_delete_status_message</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">post_and_delete_status_message</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/login</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>user_password</td>
<td>evankorth</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>user_submit</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>status_message_message</td>
<td>THIS IS A RUNNING SELENIUM TEST AAAAAAAAH</td>
</tr>
<tr>
<td>click</td>
<td>status_message_submit</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>THIS IS A RUNNING SELENIUM TEST AAAAAAAAH</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Delete</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you sure?</td>
<td></td>
</tr>
<tr>
<td>verifyTextNotPresent</td>
<td>THIS IS A RUNNING SELENIUM TEST AAAAAAAAH</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=logout</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>