public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Test for the nasty wall bug
Michael Hartl (author)
Fri Apr 25 15:16:10 -0700 2008
commit  a2bb997280bf6d453065ba3ff76698e8d11df684
tree    e5632de047a660134e069f3f0a545c69ecb3041d
parent  9a6a726e4792bceec5721df813d5c38980d114a2
...
58
59
60
61
62
63
 
 
 
 
 
64
65
66
 
67
68
69
...
58
59
60
 
 
 
61
62
63
64
65
66
 
 
67
68
69
70
0
@@ -58,12 +58,13 @@
0
       when "BlogPost"
0
         post = activity.item.commentable
0
         blog = post.blog
0
- %(#{person_link(person)} made a comment on
0
- #{someones(blog.person, person)}
0
- #{post_link("blog post", post.blog, post)})
0
+ %(#{person_link(person)} made a comment to
0
+ #{someones(blog.person, person)}
0
+ blog post #{post_link(blog, post)}.)
0
+ %(#{person_link(person)} made a comment on #{someones(pblog.person)}
0
+ #{post_link("blog post", post.blog, post)})
0
       when "Person"
0
- %(#{person_link(activity.item.commenter)} commented on
0
- #{wall(activity)})
0
+ %(#{person_link(activity.item.commenter)} commented on #{wall(parent)})
0
       end
0
     when "Connection"
0
       %(#{person_link(person)} and #{person_link(activity.item.contact)}
...
11
12
13
14
 
 
 
15
16
 
17
 
 
 
18
 
 
 
 
19
 
 
 
 
 
 
 
 
 
 
 
 
20
21
22
...
11
12
13
 
14
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -11,12 +11,33 @@
0
   end
0
   
0
   it "should have the right message for a wall comment" do
0
- person = people(:quentin)
0
+ # Quentin comments an Aaron's wall
0
+ person = @current_person
0
+ commenter = people(:quentin)
0
     comment = person.comments.create(:body => "The body",
0
- :commenter => @current_person)
0
+ :commenter => commenter)
0
     activity = Activity.find_by_item_id(comment)
0
+ # The message works even if logged in as Kelly.
0
+ login_as(:kelly)
0
+ feed_message(activity).should =~ /#{commenter.name}/
0
     feed_message(activity).should =~ /#{person.name}'s wall/
0
+ # The message works even if logged in as the commenter
0
+ login_as(commenter)
0
+ feed_message(activity).should =~ /#{commenter.name}/
0
+ feed_message(activity).should =~ /#{person.name}'s wall/
0
   end
0
+
0
+ it "should have the right message for an own-comment" do
0
+ person = @current_person
0
+ commenter = person
0
+ comment = person.comments.create(:body => "The body",
0
+ :commenter => commenter)
0
+ activity = Activity.find_by_item_id(comment)
0
+ login_as(:kelly)
0
+ feed_message(activity).should =~ /#{commenter.name}/
0
+ feed_message(activity).should =~ /their own wall/
0
+ end
0
+
0
   
0
   it "should have the right message for a blog comment" do
0
     post = posts(:blog_post)

Comments

    No one has commented yet.