Commit d0cc3c8aa04e050891e550169fae9dce0d4ed876

Authored by Larissa Reis
1 parent 6fa989a8

Fixes unfollowing profile to use POST request

app/views/blocks/profile_info_actions/_common.html.erb
1 <li><%= report_abuse(profile, :button) %></li> 1 <li><%= report_abuse(profile, :button) %></li>
2 -<%if logged_in? && (user != profile) && profile.allow_followers?%>  
3 -<li>  
4 - <% follow = user.follows?(profile) %>  
5 - <%= button(:unfollow, content_tag('span', _('Unfollow')), {:profile => profile.identifier, :controller => 'profile', :action => 'unfollow'}, :id => 'action-unfollow', :title => _("Unfollow"), :style => follow ? "" : "display: none;") %> 2 +<% if logged_in? && (user != profile) && profile.allow_followers? %>
  3 + <li>
  4 + <% follow = user.follows?(profile) %>
  5 + <%= button(:unfollow, content_tag('span', _('Unfollow')), {:profile => profile.identifier, :controller => 'profile', :action => 'unfollow'}, :method => :post, :id => 'action-unfollow', :title => _("Unfollow"), :style => follow ? "" : "display: none;") %>
6 <%= button(:ok, content_tag('span', _('Follow')), {:profile => profile.identifier, :controller => 'profile', :action => 'find_profile_circles'}, :id => 'action-follow', :title => _("Follow"), :style => follow ? "display: none;" : "") %> 6 <%= button(:ok, content_tag('span', _('Follow')), {:profile => profile.identifier, :controller => 'profile', :action => 'find_profile_circles'}, :id => 'action-follow', :title => _("Follow"), :style => follow ? "display: none;" : "") %>
7 <div id="circles-container" style="display: none;"> 7 <div id="circles-container" style="display: none;">
8 </div> 8 </div>
9 -</li>  
10 -<%end%> 9 + </li>
  10 +<% end %>
11 <%= render_environment_features(:profile_actions) %> 11 <%= render_environment_features(:profile_actions) %>
app/views/followers/_profile_list.html.erb
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <%= button_without_text :remove, content_tag('span',_('unfollow')), 7 <%= button_without_text :remove, content_tag('span',_('unfollow')),
8 { :controller => "profile", :profile => followed_profile.identifier, :follower_id => profile.id, 8 { :controller => "profile", :profile => followed_profile.identifier, :follower_id => profile.id,
9 :action => 'unfollow', :redirect_to => url_for({:controller => "followers", :profile => profile.identifier}) }, 9 :action => 'unfollow', :redirect_to => url_for({:controller => "followers", :profile => profile.identifier}) },
10 - :title => _('remove') %> 10 + :method => :post, :title => _('remove') %>
11 <%= modal_icon_button :edit, _('change category'), 11 <%= modal_icon_button :edit, _('change category'),
12 url_for(:controller => 'followers', :action => 'set_category_modal', 12 url_for(:controller => 'followers', :action => 'set_category_modal',
13 :followed_profile_id => followed_profile.id) %> 13 :followed_profile_id => followed_profile.id) %>
features/follow_profile.feature
@@ -110,6 +110,5 @@ Feature: follow profile @@ -110,6 +110,5 @@ Feature: follow profile
110 And I am logged in as "johnsnow" 110 And I am logged in as "johnsnow"
111 When I go to nightswatch's homepage 111 When I go to nightswatch's homepage
112 When I follow "Unfollow" 112 When I follow "Unfollow"
113 - And I wait 1 second  
114 Then "johnsnow" should not be a follower of "nightswatch" 113 Then "johnsnow" should not be a follower of "nightswatch"
115 114