Commit a5267bacbb4f93bc0e0eabb61303ce972d41f84e
Committed by
Joenio Costa
1 parent
4be12faf
Exists in
master
and in
29 other branches
Fixing email invitation for community and friend
(ActionItem1534)
Showing
6 changed files
with
133 additions
and
6 deletions
Show diff stats
app/views/tasks/_add_friend.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <%= link_to( profile_image(task.requestor, :minor, :border => 0), task.requestor.public_profile_url ) %> | 3 | <%= link_to( profile_image(task.requestor, :minor, :border => 0), task.requestor.public_profile_url ) %> |
4 | 4 | ||
5 | -<%= _('%s wants to connect to you as a friend.') % | 5 | +<%= _('%s wants to be your friend.') % |
6 | content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ) %> | 6 | content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ) %> |
7 | 7 | ||
8 | <% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> | 8 | <% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> |
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +<%= render :partial => 'add_friend', :locals => {:task => task} %> |
@@ -0,0 +1,29 @@ | @@ -0,0 +1,29 @@ | ||
1 | +<h2><%= _('Join community') %></h2> | ||
2 | + | ||
3 | +<%= link_to( profile_image(task.requestor, :minor, :border => 0), task.requestor.public_profile_url ) %> | ||
4 | + | ||
5 | +<%= _('%s invites you to join the community %s.') % | ||
6 | + [content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ), | ||
7 | + content_tag('strong', link_to( task.community.name, task.community.public_profile_url ) )] %> | ||
8 | + | ||
9 | +<% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %> | ||
10 | + | ||
11 | + <div> | ||
12 | + <%= radio_button_tag(:decision, 'finish', true, | ||
13 | + :id => "decision-finish-#{task.id}", | ||
14 | + :onclick => "Element.show('group-for-friend-#{task.id}')") %> | ||
15 | + <label for="<%= "decision-finish-#{task.id}" %>"><b><%= _('Accept') %></b></label> | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + <%= radio_button_tag(:decision, 'cancel', false, | ||
20 | + :id => "decision-cancel-#{task.id}", | ||
21 | + :onclick => "Element.hide('group-for-friend-#{task.id}')") %> | ||
22 | + <label for="<%= "decision-cancel-#{task.id}" %>"><b><%= _('Reject') %></b></label> | ||
23 | + | ||
24 | + </div> | ||
25 | + | ||
26 | + <% button_bar do %> | ||
27 | + <%= submit_button(:ok, _('Ok!')) %> | ||
28 | + <% end %> | ||
29 | +<% end %> |
features/invitation.feature
@@ -4,9 +4,9 @@ Feature: invitation | @@ -4,9 +4,9 @@ Feature: invitation | ||
4 | 4 | ||
5 | Background: | 5 | Background: |
6 | Given the following users | 6 | Given the following users |
7 | - | login | | ||
8 | - | josesilva | | ||
9 | - | josesantos | | 7 | + | login | email | |
8 | + | josesilva | silva@invalid.br | | ||
9 | + | josesantos | santos@invalid.br | | ||
10 | And the following communities | 10 | And the following communities |
11 | | owner | identifier | name | | 11 | | owner | identifier | name | |
12 | | josesilva | 26-bsslines | 26 Bsslines | | 12 | | josesilva | 26-bsslines | 26 Bsslines | |
@@ -72,14 +72,89 @@ Feature: invitation | @@ -72,14 +72,89 @@ Feature: invitation | ||
72 | Then I should see "Access denied" | 72 | Then I should see "Access denied" |
73 | 73 | ||
74 | Scenario: not see link to invite members to enterprise in manage members | 74 | Scenario: not see link to invite members to enterprise in manage members |
75 | - Given I am on /myprofile/beatles-for-sale/profile_members | 75 | + Given I am on Beatles For Sale's members management |
76 | Then I should not see "Invite your friends to join Beatles For Sale" link | 76 | Then I should not see "Invite your friends to join Beatles For Sale" link |
77 | 77 | ||
78 | Scenario: back to manage members after invite friends | 78 | Scenario: back to manage members after invite friends |
79 | - Given I am on /myprofile/26-bsslines/profile_members | 79 | + Given I am on 26 Bsslines's members management |
80 | And I follow "Invite your friends to join 26 Bsslines" | 80 | And I follow "Invite your friends to join 26 Bsslines" |
81 | And I press "Next" | 81 | And I press "Next" |
82 | And I fill in "manual_import_addresses" with "misfits@devil.doll" | 82 | And I fill in "manual_import_addresses" with "misfits@devil.doll" |
83 | And I fill in "mail_template" with "Follow this link <url>" | 83 | And I fill in "mail_template" with "Follow this link <url>" |
84 | When I press "Invite my friends!" | 84 | When I press "Invite my friends!" |
85 | Then I should be on /myprofile/26-bsslines/profile_members | 85 | Then I should be on /myprofile/26-bsslines/profile_members |
86 | + | ||
87 | + Scenario: noosfero user receives a task when a user invites to join a community | ||
88 | + Given I am on 26 Bsslines's members management | ||
89 | + And I follow "Invite your friends to join 26 Bsslines" | ||
90 | + And I press "Next" | ||
91 | + And I fill in "manual_import_addresses" with "santos@invalid.br" | ||
92 | + And I fill in "mail_template" with "Follow this link <url>" | ||
93 | + And I press "Invite my friends!" | ||
94 | + When I am logged in as "josesantos" | ||
95 | + And I follow "Control Panel" | ||
96 | + And I should see "josesilva invites you to join the community 26 Bsslines." | ||
97 | + | ||
98 | + Scenario: noosfero user accepts to join community | ||
99 | + Given I invite email "santos@invalid.br" to join community "26 Bsslines" | ||
100 | + When I am logged in as "josesantos" | ||
101 | + And I follow "Control panel" | ||
102 | + And I follow "Process requests" | ||
103 | + And I should see "josesilva invites you to join the community 26 Bsslines." | ||
104 | + And I choose "Accept" | ||
105 | + When I press "Ok!" | ||
106 | + Then I should not see "josesilva invites you to join the community 26 Bsslines." | ||
107 | + When I follow "Control panel" | ||
108 | + And I follow "Manage my groups" | ||
109 | + Then I should see "26 Bsslines" | ||
110 | + | ||
111 | + Scenario: noosfero user rejects to join community | ||
112 | + Given I invite email "santos@invalid.br" to join community "26 Bsslines" | ||
113 | + When I am logged in as "josesantos" | ||
114 | + And I follow "Control panel" | ||
115 | + And I follow "Process requests" | ||
116 | + And I should see "josesilva invites you to join the community 26 Bsslines." | ||
117 | + And I choose "Reject" | ||
118 | + When I press "Ok!" | ||
119 | + Then I should not see "josesilva invites you to join the community 26 Bsslines." | ||
120 | + When I follow "Control panel" | ||
121 | + And I follow "Manage my groups" | ||
122 | + Then I should not see "26 Bsslines" | ||
123 | + | ||
124 | + Scenario: noosfero user receives a task when a user invites to be friend | ||
125 | + Given I am on josesilva's control panel | ||
126 | + And I follow "Manage Friends" | ||
127 | + And I follow "Invite people from my e-mail contacts" | ||
128 | + And I press "Next" | ||
129 | + And I fill in "manual_import_addresses" with "santos@invalid.br" | ||
130 | + And I fill in "mail_template" with "Follow this link <url>" | ||
131 | + And I press "Invite my friends!" | ||
132 | + When I am logged in as "josesantos" | ||
133 | + And I follow "Control Panel" | ||
134 | + And I should see "josesilva wants to be your friend." | ||
135 | + | ||
136 | + Scenario: noosfero user accepts to be friend | ||
137 | + Given I invite email "santos@invalid.br" to be my friend | ||
138 | + When I am logged in as "josesantos" | ||
139 | + And I follow "Control panel" | ||
140 | + And I follow "Process requests" | ||
141 | + And I should see "josesilva wants to be your friend." | ||
142 | + And I choose "Accept" | ||
143 | + When I press "Ok!" | ||
144 | + And I should not see "josesilva wants to be your friend." | ||
145 | + When I follow "Control panel" | ||
146 | + And I follow "Manage friends" | ||
147 | + Then I should see "josesilva" | ||
148 | + | ||
149 | + Scenario: noosfero user rejects to be friend | ||
150 | + Given I invite email "santos@invalid.br" to be my friend | ||
151 | + When I am logged in as "josesantos" | ||
152 | + And I follow "Control panel" | ||
153 | + And I follow "Process requests" | ||
154 | + And I should see "josesilva wants to be your friend." | ||
155 | + And I choose "Ignore" | ||
156 | + When I press "Ok!" | ||
157 | + And I should not see "josesilva wants to be your friend." | ||
158 | + When I follow "Control panel" | ||
159 | + And I follow "Manage friends" | ||
160 | + Then I should not see "josesilva" |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| | ||
2 | + identifier = Community.find_by_name(community).identifier | ||
3 | + visit("/myprofile/#{identifier}/profile_members") | ||
4 | + click_link('Invite your friends to join 26 Bsslines') | ||
5 | + click_button('Next') | ||
6 | + fill_in('manual_import_addresses', :with => "#{email}") | ||
7 | + fill_in('mail_template', :with => 'Follow this link <url>') | ||
8 | + click_button("Invite my friends!") | ||
9 | +end | ||
10 | + | ||
11 | +Given /^I invite email "(.+)" to be my friend$/ do |email| | ||
12 | + click_link('Control panel') | ||
13 | + click_link('Manage friends') | ||
14 | + click_link('Invite people from my e-mail contacts') | ||
15 | + click_button('Next') | ||
16 | + fill_in('manual_import_addresses', :with => "#{email}") | ||
17 | + fill_in('mail_template', :with => 'Follow this link <url>') | ||
18 | + click_button("Invite my friends!") | ||
19 | +end |
features/support/paths.rb
@@ -45,6 +45,9 @@ module NavigationHelpers | @@ -45,6 +45,9 @@ module NavigationHelpers | ||
45 | when /^(.+)'s cms/ | 45 | when /^(.+)'s cms/ |
46 | '/myprofile/%s/cms' % Profile.find_by_name($1).identifier | 46 | '/myprofile/%s/cms' % Profile.find_by_name($1).identifier |
47 | 47 | ||
48 | + when /^(.+)'s members management/ | ||
49 | + '/myprofile/%s/profile_members' % Profile.find_by_name($1).identifier | ||
50 | + | ||
48 | # Add more mappings here. | 51 | # Add more mappings here. |
49 | # Here is a more fancy example: | 52 | # Here is a more fancy example: |
50 | # | 53 | # |