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:
Added break up link on a profile page if current_person is
connected with the person
Jorge Dias (author)
Mon Apr 28 06:24:36 -0700 2008
Michael Hartl (committer)
Wed May 07 11:37:46 -0700 2008
commit  dc948b1f5115554fd6910f7ffea66a83244b7f33
tree    6d0b125e6b24d243630dfa0b8fa856acf9a8f30e
parent  79a8f5b07a033276fc7406fd3c9d1ae6745536a5
...
12
13
14
15
 
16
17
18
...
12
13
14
 
15
16
17
18
0
@@ -12,7 +12,7 @@
0
                                 :image => :bounded_icon,
0
                                 
0
                                 :destroy => (current_person? @person), #destroy if in own profile
0
-       :send_message => (current_person? (@person)) %>
0
+   :send_message => (current_person? (@person)) %>
0
       </li>
0
     <%- end -%>
0
       
...
21
22
23
24
 
 
 
 
 
25
26
27
...
21
22
23
 
24
25
26
27
28
29
30
31
0
@@ -21,7 +21,11 @@
0
             </li>
0
           <%- end -%>
0
           <%- if Connection.connected?(@person, current_person) -%>
0
- <li><%= h @person.name %> is one of your contacts</li>
0
+ <li><%= h @person.name %> is one of your contacts </li>
0
+   <li><%= link_to "break up",
0
+     connection_path(Connection.conn(current_person,@person)),
0
+     :method => :delete,
0
+   :confirm => "Are you sure you want to break up with #{@person.name}" %></li>
0
           <%- end -%>
0
           <li><%= email_link @person %></li>
0
         <%- end -%>
...
7
8
9
 
10
...
7
8
9
10
11
0
@@ -7,5 +7,6 @@
0
   <p class="meta published">
0
     <%= time_ago_in_words minifeed_item.created_at %> ago
0
   </p>
0
+ </li>
0
 <%- end -%>
...
215
216
217
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
220
221
...
215
216
217
 
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
0
@@ -215,7 +215,24 @@
0
     it "should not display a deactivated person" do
0
       @person.toggle!(:deactivated)
0
       get :show, :id => @person
0
- @response.should redirect_to(home_url)
0
+ response.should redirect_to(home_url)
0
+ end
0
+
0
+ it "should display break up link if connected" do
0
+ login_as(@person)
0
+ @contact = people(:aaron)
0
+ conn = Connection.request(@person,@contact)
0
+ conn.accept
0
+ get :show, :id => @contact.reload
0
+ response.should have_tag("a", :text => "break up")
0
+ response.should have_tag("a[href=?]", connection_path(conn))
0
+ end
0
+
0
+ it "should not display break up link if not connected" do
0
+ login_as(@person)
0
+ @contact = people(:aaron)
0
+ get :show, :id => @contact.reload
0
+ response.should_not have_tag("a", :text => "break up")
0
     end
0
   end
0
   
...
18
19
20
 
21
...
18
19
20
21
22
0
@@ -18,5 +18,6 @@
0
   it "should have a description rendered by Markdown" do
0
     response.should have_tag("em", "bar")
0
   end
0
+
0
 end

Comments

    No one has commented yet.