From c95ceecf9e154f4d25a11f810fd409b7e854ced0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 30 Jul 2010 12:40:02 -0700 Subject: [PATCH] Clarified socket helper, added a selenium test --- app/helpers/sockets_helper.rb | 8 ++- test/selenium/diaspora_selenium | 14 ++++ test/selenium/post_and_delete_status_message | 67 ++++++++++++++++++++ 3 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 test/selenium/diaspora_selenium create mode 100644 test/selenium/post_and_delete_status_message diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index 1e9dcc508..27a86a8e5 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -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 diff --git a/test/selenium/diaspora_selenium b/test/selenium/diaspora_selenium new file mode 100644 index 000000000..32250bf37 --- /dev/null +++ b/test/selenium/diaspora_selenium @@ -0,0 +1,14 @@ + + + + + + Test Suite + + + + + +
Test Suite
Diaspora_selenium
+ + diff --git a/test/selenium/post_and_delete_status_message b/test/selenium/post_and_delete_status_message new file mode 100644 index 000000000..911bd3c7e --- /dev/null +++ b/test/selenium/post_and_delete_status_message @@ -0,0 +1,67 @@ + + + + + + +post_and_delete_status_message + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
post_and_delete_status_message
open/login
typeuser_passwordevankorth
clickAndWaituser_submit
typestatus_message_messageTHIS IS A RUNNING SELENIUM TEST AAAAAAAAH
clickstatus_message_submit
verifyTextPresentTHIS IS A RUNNING SELENIUM TEST AAAAAAAAH
clicklink=Delete
assertConfirmationAre you sure?
verifyTextNotPresentTHIS IS A RUNNING SELENIUM TEST AAAAAAAAH
clickAndWaitlink=logout
+ +