personal help in tests =)

0 views
Skip to first unread message

Essam Hafez

unread,
May 11, 2012, 10:37:13 AM5/11/12
to smartsoft-c2-12
7d yrkz m3aya fe elklmten dol =D

now am creating tests for my stories, just need to make sure am on the
right track. =)

2.10 A user should be able to see a feed of stories from social
networks (filterable)
my test includes the following :- ( test for the model (unit test ))

assert user.has_social_network // create this method in users
controller/model
loop 3la elnetworks ely 3ndo w aget elfeed // 7d y2oly which model
3ndo elconnected social networks ?

test succeeded



2.11 A user should be able to filter the social networks he wants to
receive stories from
my test includes the following :- ( test for the view (functional test ))

call method that get stories from the selected feed
a get one story aw aloop 3lehom to get title_i_get , content_i_get w
a call this
assert_select 'title', "title_i_get"
assert_select 'content', "content_i_get"
test succeeded

2.27 Add Tumblr account to list of accounts and/or get data
unit test

73ml account, w ad5l elinfo register beta
ad5l elaccount fe Haccount
get feed

test succeeded



--
Essam Hafez
essamah...@gmail.com
+2 (0100) 1152697

Yahia El Gamal

unread,
May 11, 2012, 10:48:36 AM5/11/12
to smartso...@googlegroups.com
Do not use Haccount, Haccount is deprecated and will be deleted. 

the social network accounts will belong_to user and a user will have different social accounts. 
--
Yahia

Mohamed El-Menisy

unread,
May 11, 2012, 10:52:40 AM5/11/12
to smartso...@googlegroups.com
So social account classes like "TwitterAcount" will extend a SocialAccount class?

Yahia El Gamal

unread,
May 11, 2012, 10:57:26 AM5/11/12
to smartso...@googlegroups.com
It should yes, but we need to know what's exactly the common between different API and authentication systems before we do that step. The goal is to have User.social_accounts which returns a list of all the social accounts a user has. 
--
Yahia

Mohamed El-Menisy

unread,
May 11, 2012, 10:59:20 AM5/11/12
to smartso...@googlegroups.com
Even if we don't, if we just extend this class without having any functionality in it this can still be done.  

Yahia El Gamal

unread,
May 11, 2012, 11:01:12 AM5/11/12
to smartso...@googlegroups.com
Yes I am aware of that. I will actually give it a try 

Sent from iPhone 

Yahia El Gamal

unread,
May 11, 2012, 11:03:23 AM5/11/12
to smartso...@googlegroups.com
But my concern is, social networks get their feeds in different ways. And the User.social_accounts will help us to for example, loop on all social networks and get the feed of all of them, therefore, a unified get_feed method must be included. That's why I wanted to have a more mature overview on the social networks before we do it. 
--
Yahia

Essam Hafez

unread,
May 11, 2012, 11:03:25 AM5/11/12
to smartso...@googlegroups.com
then
assert user.has_social_network //method i was going to implement
will be replaced by
assert !User.social_accounts.nil

User.social_accounts de method wla lma yb2a social_accounts dh super
class 7tb2a automatically done ?

Yahia El Gamal

unread,
May 11, 2012, 11:04:25 AM5/11/12
to smartso...@googlegroups.com
ignore the social_accounts elly ana 2oltoo, just make it a tumblr account (just like twitter now). 
User.tumblr_account 
--
Yahia

Yahia El Gamal

unread,
May 11, 2012, 11:05:11 AM5/11/12
to smartso...@googlegroups.com
I was just giving you a heads up of I was thinking of (as well as what Dr. Fatma has pointed out) 
--
Yahia

Essam Hafez

unread,
May 11, 2012, 11:05:55 AM5/11/12
to smartso...@googlegroups.com
@Yahia we should have a method called get_social_feeds w feha kol
elcalled methods bta3t kol wa7d

def get_social_feed
get_twitter_feed
get_facebook_feed
get_tumblr_feed
...
....
end

so C1 will call only this method to generate man feed.

Essam Hafez

unread,
May 11, 2012, 11:06:43 AM5/11/12
to smartso...@googlegroups.com
main*

Yahia El Gamal

unread,
May 11, 2012, 11:08:52 AM5/11/12
to smartso...@googlegroups.com
Yes, and so far, we have a method in twitter_account called get_feed(pages=1) which takes the page number as a parameter with a default value of one. 

In the social networks stories, everyone (as written in the backlog) will provide a method to get the feed from the social network. So to be more concrete, you will call twitter_account_instance.get_feed and tumber_account_instance.get_feed ..etc 
--
Yahia

Reply all
Reply to author
Forward
0 new messages