Commit 3a5bb3137b0efa2452a4db4184c13dfdd7d69b99

Authored by Victor Costa
1 parent 7372a547

rails3: fix profile_controller tests

app/views/profile/_create_article.html.erb
... ... @@ -9,7 +9,7 @@
9 9 <div class='profile-activity-lead'>
10 10 <div class='article-name'><%= link_to(activity.params['name'], activity.params['url']) %></div>
11 11 <span title='<%= activity.target.class.short_description %>' class='profile-activity-icon icon-new icon-new<%= activity.target.class.icon_name %>'></span>
12   - <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') %> <small><%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %></small>
  12 + <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') unless activity.params['lead'].blank? %> <small><%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %></small>
13 13 </div>
14 14 <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>
15 15 <p class='profile-activity-time'><%= time_ago_as_sentence(activity.created_at) %></p>
... ...
app/views/profile/content_tagged.html.erb
1   -<% add_rss_feed_to_head(_("%s's contents tagged with \"%s\"") % [profile.name, @tag], tag_feed_path) %>
  1 +<% escaped_tag = CGI.escapeHTML(@tag) %>
2 2  
3   -<h1><%= _('Content tagged with "%s"') % CGI.escapeHTML(@tag) %></h1>
  3 +<% add_rss_feed_to_head(_("%s's contents tagged with \"%s\"") % [profile.name, escaped_tag], tag_feed_path) %>
  4 +
  5 +<h1><%= _('Content tagged with "%s"') % escaped_tag %></h1>
4 6  
5 7 <p>
6 8 <%= link_to image_tag('icons-mime/rss-feed.png', :alt => _('Feed for this tag'), :title => _('Feed for this tag')), tag_feed_path, :class => 'blog-feed-link'%>
... ... @@ -18,6 +20,6 @@
18 20 <%= pagination_links @tagged, :param_name => 'npage' %>
19 21  
20 22 <div>
21   - <%= link_to _('See content tagged with "%s" in the entire site') % CGI.escapeHTML(@tag), :controller => 'search', :action => 'tag', :tag => @tag %>
  23 + <%= link_to _('See content tagged with "%s" in the entire site') % escaped_tag, :controller => 'search', :action => 'tag', :tag => @tag %>
22 24 </div>
23 25 <% end %>
... ...
config/routes.rb
... ... @@ -72,7 +72,7 @@ Noosfero::Application.routes.draw do
72 72  
73 73 # profile tags
74 74 match 'profile/:profile/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format}/
75   - match 'profile/:profile/tags', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format}/
  75 + match 'profile/:profile/tags(/:id)', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format}/
76 76  
77 77 # profile search
78 78 match 'profile/:profile/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format}/
... ...
test/functional/profile_controller_test.rb
... ... @@ -843,7 +843,7 @@ class ProfileControllerTest &lt; ActionController::TestCase
843 843 user.stubs(:login).returns('some')
844 844 @controller.stubs(:current_user).returns(user)
845 845 get :index, :profile => p1.identifier
846   - assert_equal 15, assigns(:network_activities).count
  846 + assert_equal 15, assigns(:network_activities).size
847 847 end
848 848  
849 849 should 'the network activity be visible only to logged users' do
... ...