We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

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
Added preferences link to connection_request email
Michael Hartl (author)
Mon May 12 12:32:44 -0700 2008
commit  8d9dc0d026abce4fb4bd00a5e9aefca62e5623d8
tree    61ca39b0b577d79cf7e8d1e7f0509219e42462b0
parent  e222d82498dd22da6a2935ed17c01f72134b2c2f
...
1
 
2
3
4
 
 
 
 
 
5
...
 
1
2
 
3
4
5
6
7
8
9
0
@@ -1,3 +1,7 @@
0
-You have a new connection request from <%= @connection.contact.name %>
0
+You have a new connection request from <%= @connection.person.name %>:
0
 
0
-http://<%= @domain %>/connections/<%= @connection.to_param %>/edit
0
\ No newline at end of file
0
+http://<%= @domain %>/connections/<%= @connection.to_param %>/edit
0
+
0
+To change your email notification preferences, visit
0
+
0
+http://<%= @domain %>/people/<%= @connection.contact.to_param %>
0
\ No newline at end of file
...
60
61
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
64
65
...
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
0
@@ -60,6 +60,37 @@ describe Comment do
0
         @person.activities.should have_distinct_elements
0
       end
0
     end
0
+
0
+ # describe "email notifications" do
0
+ #
0
+ # before(:each) do
0
+ # @emails = ActionMailer::Base.deliveries
0
+ # @emails.clear
0
+ # @global_prefs = Preference.find(:first)
0
+ # end
0
+ #
0
+ # it "should send an email when global/recipient notifications are on" do
0
+ # # Both notifications are on by default.
0
+ # lambda do
0
+ # @comment.save
0
+ # end.should change(@emails, :length).by(1)
0
+ # end
0
+ #
0
+ # it "should not send an email when recipient's notifications are off" do
0
+ # @recipient.toggle!(:message_notifications)
0
+ # @recipient.message_notifications.should == false
0
+ # lambda do
0
+ # @comment.save
0
+ # end.should_not change(@emails, :length).by(1)
0
+ # end
0
+ #
0
+ # it "should not send an email when global notifications are off" do
0
+ # @global_prefs.update_attributes(:email_notifications => false)
0
+ # lambda do
0
+ # @comment.save
0
+ # end.should_not change(@emails, :length).by(1)
0
+ # end
0
+ # end
0
   end
0
 
0
   describe "wall comments" do
...
50
51
52
 
53
54
55
56
 
57
58
59
 
 
 
 
 
60
61
62
...
64
65
66
 
 
 
 
 
67
68
69
...
50
51
52
53
54
55
56
 
57
58
59
 
60
61
62
63
64
65
66
67
...
69
70
71
72
73
74
75
76
77
78
79
0
@@ -50,13 +50,18 @@ describe PersonMailer do
0
        @connection = Connection.request(people(:quentin), people(:aaron))
0
        @email = PersonMailer.create_connection_request(@connection)
0
        @person = @connection.person
0
+ @contact = @connection.contact
0
      end
0
      
0
      it "should have the right recipient" do
0
- @email.to.first.should == @connection.contact.email
0
+ @email.to.first.should == @contact.email
0
      end
0
      
0
- it "should have a URL to the contact" do
0
+ it "should have the right requester" do
0
+ @email.body.should =~ /#{@person.name}/
0
+ end
0
+
0
+ it "should have a URL to the connection" do
0
        url = "/connections/#{@connection.id}/edit"
0
        @email.body.should =~ /#{url}/
0
      end
0
@@ -64,6 +69,11 @@ describe PersonMailer do
0
      it "should have the right domain in the body" do
0
         @email.body.should =~ /#{@preferences.domain}/
0
      end
0
+
0
+ it "should have a link to the sender's preferences" do
0
+ prefs_url = "#{@preferences.domain}/people/#{@contact.to_param}"
0
+ @email.body.should =~ /#{prefs_url}/
0
+ end
0
    end
0
    
0
    describe "email verification" do

Comments

    No one has commented yet.