Commit aa583a316faea34e1291209aaabca79b6cc1b6ed
Exists in
master
and in
28 other branches
Merge branch 'stable'
Showing
20 changed files
with
97 additions
and
55 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
@@ -232,6 +232,7 @@ class CmsController < MyProfileController | @@ -232,6 +232,7 @@ class CmsController < MyProfileController | ||
232 | end | 232 | end |
233 | end | 233 | end |
234 | if @failed.blank? | 234 | if @failed.blank? |
235 | + flash[:notice] = _("Your publish request was sent successfully") | ||
235 | redirect_back | 236 | redirect_back |
236 | end | 237 | end |
237 | end | 238 | end |
app/controllers/my_profile/memberships_controller.rb
@@ -29,7 +29,7 @@ class MembershipsController < MyProfileController | @@ -29,7 +29,7 @@ class MembershipsController < MyProfileController | ||
29 | @community = Community.find(params[:id]) | 29 | @community = Community.find(params[:id]) |
30 | if request.post? | 30 | if request.post? |
31 | if @community.destroy | 31 | if @community.destroy |
32 | - flash[:notice] = _('%s was destroyed!') % @community.short_name | 32 | + flash[:notice] = _('%s was removed.') % @community.short_name |
33 | redirect_to :action => 'index' | 33 | redirect_to :action => 'index' |
34 | end | 34 | end |
35 | end | 35 | end |
app/controllers/public/profile_controller.rb
@@ -21,7 +21,7 @@ class ProfileController < PublicController | @@ -21,7 +21,7 @@ class ProfileController < PublicController | ||
21 | end | 21 | end |
22 | end | 22 | end |
23 | 23 | ||
24 | - def tag | 24 | + def content_tagged |
25 | @tag = params[:id] | 25 | @tag = params[:id] |
26 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_#{profile.id.to_s}_page_#{params[:npage]}" | 26 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_#{profile.id.to_s}_page_#{params[:npage]}" |
27 | if is_cache_expired?(@tag_cache_key, true) | 27 | if is_cache_expired?(@tag_cache_key, true) |
@@ -37,7 +37,7 @@ class ProfileController < PublicController | @@ -37,7 +37,7 @@ class ProfileController < PublicController | ||
37 | tagged, | 37 | tagged, |
38 | :title => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], | 38 | :title => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], |
39 | :description => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], | 39 | :description => _("%s's contents tagged with \"%s\"") % [profile.name, @tag], |
40 | - :link => url_for(:action => 'tag') | 40 | + :link => url_for(:action => 'tags') |
41 | ) | 41 | ) |
42 | render :text => data, :content_type => "text/xml" | 42 | render :text => data, :content_type => "text/xml" |
43 | end | 43 | end |
app/models/person.rb
@@ -270,20 +270,20 @@ class Person < Profile | @@ -270,20 +270,20 @@ class Person < Profile | ||
270 | 270 | ||
271 | def communities_cache_key(params = {}) | 271 | def communities_cache_key(params = {}) |
272 | page = params[:npage] || '1' | 272 | page = params[:npage] || '1' |
273 | - identifier + '-communities-page-' + page | 273 | + cache_key + '-communities-page-' + page |
274 | end | 274 | end |
275 | 275 | ||
276 | def friends_cache_key(params = {}) | 276 | def friends_cache_key(params = {}) |
277 | page = params[:npage] || '1' | 277 | page = params[:npage] || '1' |
278 | - identifier + '-friends-page-' + page | 278 | + cache_key + '-friends-page-' + page |
279 | end | 279 | end |
280 | 280 | ||
281 | def manage_friends_cache_key(params = {}) | 281 | def manage_friends_cache_key(params = {}) |
282 | page = params[:npage] || '1' | 282 | page = params[:npage] || '1' |
283 | - identifier + '-manage-friends-page-' + page | 283 | + cache_key + '-manage-friends-page-' + page |
284 | end | 284 | end |
285 | 285 | ||
286 | def relationships_cache_key | 286 | def relationships_cache_key |
287 | - identifier + '-profile-relationships' | 287 | + cache_key + '-profile-relationships' |
288 | end | 288 | end |
289 | end | 289 | end |
app/models/profile.rb
@@ -679,7 +679,7 @@ private :generate_url, :url_options | @@ -679,7 +679,7 @@ private :generate_url, :url_options | ||
679 | 679 | ||
680 | def members_cache_key(params = {}) | 680 | def members_cache_key(params = {}) |
681 | page = params[:npage] || '1' | 681 | page = params[:npage] || '1' |
682 | - identifier + '-members-page-' + page | 682 | + cache_key + '-members-page-' + page |
683 | end | 683 | end |
684 | 684 | ||
685 | protected | 685 | protected |
app/models/tags_block.rb
@@ -32,7 +32,7 @@ class TagsBlock < Block | @@ -32,7 +32,7 @@ class TagsBlock < Block | ||
32 | block_title(title) + | 32 | block_title(title) + |
33 | "\n<div class='tag_cloud'>\n"+ | 33 | "\n<div class='tag_cloud'>\n"+ |
34 | tag_cloud( tags, :id, | 34 | tag_cloud( tags, :id, |
35 | - owner.public_profile_url.merge(:controller => 'profile', :action => 'tag'), | 35 | + owner.public_profile_url.merge(:controller => 'profile', :action => 'tags'), |
36 | :max_size => 16, :min_size => 9 ) + | 36 | :max_size => 16, :min_size => 9 ) + |
37 | "\n</div><!-- end class='tag_cloud' -->\n"; | 37 | "\n</div><!-- end class='tag_cloud' -->\n"; |
38 | end | 38 | end |
app/views/content_viewer/view_page.rhtml
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | <% if !@page.tags.empty? %> | 66 | <% if !@page.tags.empty? %> |
67 | <div id="article-tags"> | 67 | <div id="article-tags"> |
68 | <%= _("This article's tags:") %> | 68 | <%= _("This article's tags:") %> |
69 | - <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %> | 69 | + <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }.join("\n") %> |
70 | </div> | 70 | </div> |
71 | <% end %> | 71 | <% end %> |
72 | 72 |
@@ -0,0 +1,23 @@ | @@ -0,0 +1,23 @@ | ||
1 | +<% add_rss_feed_to_head(_("%s's contents tagged with \"%s\"") % [profile.name, @tag], tag_feed_path) %> | ||
2 | + | ||
3 | +<h1><%= _('Content tagged with "%s"') % @tag %></h1> | ||
4 | + | ||
5 | +<p> | ||
6 | +<%= 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'%> | ||
7 | +</p> | ||
8 | + | ||
9 | +<% cache_timeout(@tag_cache_key, 4.hour.from_now) do %> | ||
10 | + <div class='search-tagged-items'> | ||
11 | + <ul> | ||
12 | + <% for doc in @tagged %> | ||
13 | + <li><%= link_to doc.title, doc.url %></li> | ||
14 | + <% end %> | ||
15 | + </ul> | ||
16 | + </div> | ||
17 | + | ||
18 | + <%= pagination_links @tagged, :param_name => 'npage' %> | ||
19 | + | ||
20 | + <div> | ||
21 | + <%= link_to _('See content tagged with "%s" in the entire site') % @tag, :controller => 'search', :action => 'tag', :tag => @tag %> | ||
22 | + </div> | ||
23 | +<% end %> |
app/views/profile/index.rhtml
@@ -4,19 +4,19 @@ | @@ -4,19 +4,19 @@ | ||
4 | 4 | ||
5 | <% if @action %> | 5 | <% if @action %> |
6 | <%= render :partial => 'private_profile' %> | 6 | <%= render :partial => 'private_profile' %> |
7 | -<% end %> | ||
8 | - | ||
9 | -<% if !@action %> | ||
10 | - <div class='public-profile-description'> | ||
11 | - <%= profile.description %> | ||
12 | - </div> | 7 | +<% else %> |
8 | + <% unless profile.description.blank? %> | ||
9 | + <div class='public-profile-description'> | ||
10 | + <%= profile.description %> | ||
11 | + </div> | ||
12 | + <% end %> | ||
13 | <% end %> | 13 | <% end %> |
14 | 14 | ||
15 | <table class='profile'> | 15 | <table class='profile'> |
16 | <%= render :partial => partial_for_class(profile.class) %> | 16 | <%= render :partial => partial_for_class(profile.class) %> |
17 | 17 | ||
18 | <% unless @action %> | 18 | <% unless @action %> |
19 | - <% cache_timeout(profile.identifier + '-profile-general-info', 4.hours.from_now) do %> | 19 | + <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours.from_now) do %> |
20 | <tr> | 20 | <tr> |
21 | <th colspan='2'> | 21 | <th colspan='2'> |
22 | <%= _('Content') %> | 22 | <%= _('Content') %> |
@@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
51 | <%= _('Tags:') %> | 51 | <%= _('Tags:') %> |
52 | </td> | 52 | </td> |
53 | <td> | 53 | <td> |
54 | - <%= tag_cloud @tags, :id, { :action => 'tag' }, :max_size => 18, :min_size => 10%> | 54 | + <%= tag_cloud @tags, :id, { :action => 'tags' }, :max_size => 18, :min_size => 10%> |
55 | </td> | 55 | </td> |
56 | </tr> | 56 | </tr> |
57 | 57 |
app/views/profile/tag.rhtml
@@ -1,23 +0,0 @@ | @@ -1,23 +0,0 @@ | ||
1 | -<% add_rss_feed_to_head(_("%s's contents tagged with \"%s\"") % [profile.name, @tag], tag_feed_path) %> | ||
2 | - | ||
3 | -<h1><%= _('Content tagged with "%s"') % @tag %></h1> | ||
4 | - | ||
5 | -<p> | ||
6 | -<%= 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'%> | ||
7 | -</p> | ||
8 | - | ||
9 | -<% cache_timeout(@tag_cache_key, 4.hour.from_now) do %> | ||
10 | - <div class='search-tagged-items'> | ||
11 | - <ul> | ||
12 | - <% for doc in @tagged %> | ||
13 | - <li><%= link_to doc.title, doc.url %></li> | ||
14 | - <% end %> | ||
15 | - </ul> | ||
16 | - </div> | ||
17 | - | ||
18 | - <%= pagination_links @tagged, :param_name => 'npage' %> | ||
19 | - | ||
20 | - <div> | ||
21 | - <%= link_to _('See content tagged with "%s" in the entire site') % @tag, :controller => 'search', :action => 'tag', :tag => @tag %> | ||
22 | - </div> | ||
23 | -<% end %> |
app/views/profile/tags.rhtml
@@ -2,6 +2,6 @@ | @@ -2,6 +2,6 @@ | ||
2 | 2 | ||
3 | <div class='tag_cloud'> | 3 | <div class='tag_cloud'> |
4 | <% cache_timeout(@tags_cache_key, 4.hour.from_now) do %> | 4 | <% cache_timeout(@tags_cache_key, 4.hour.from_now) do %> |
5 | - <%= tag_cloud @tags, :id, { :action => :tag}, {:show_count => true} %> | 5 | + <%= tag_cloud @tags, :id, { :action => :tags }, {:show_count => true} %> |
6 | <% end %> | 6 | <% end %> |
7 | </div> | 7 | </div> |
config/routes.rb
@@ -66,7 +66,11 @@ ActionController::Routing::Routes.draw do |map| | @@ -66,7 +66,11 @@ ActionController::Routing::Routes.draw do |map| | ||
66 | map.invite 'profile/:profile/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format}/ | 66 | map.invite 'profile/:profile/invite/:action', :controller => 'invite', :profile => /#{Noosfero.identifier_format}/ |
67 | 67 | ||
68 | # feeds per tag | 68 | # feeds per tag |
69 | - map.tag_feed 'profile/:profile/tag/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.*/, :profile => /#{Noosfero.identifier_format}/ | 69 | + map.tag_feed 'profile/:profile/tags/:id/feed', :controller => 'profile', :action =>'tag_feed', :id => /.+/, :profile => /#{Noosfero.identifier_format}/ |
70 | + | ||
71 | + # profile tags | ||
72 | + map.tag 'profile/:profile/tags/:id', :controller => 'profile', :action => 'content_tagged', :id => /.+/, :profile => /#{Noosfero.identifier_format}/ | ||
73 | + map.tag 'profile/:profile/tags', :controller => 'profile', :action => 'tags', :profile => /#{Noosfero.identifier_format}/ | ||
70 | 74 | ||
71 | # public profile information | 75 | # public profile information |
72 | map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/ | 76 | map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/ |
features/tags.feature
@@ -31,3 +31,12 @@ Feature: tags | @@ -31,3 +31,12 @@ Feature: tags | ||
31 | And I follow "whales" | 31 | And I follow "whales" |
32 | Then I should see "save the whales" | 32 | Then I should see "save the whales" |
33 | And I should not see "the Amazon is being destroyed" | 33 | And I should not see "the Amazon is being destroyed" |
34 | + | ||
35 | + Scenario: viewing profile's tag cloud | ||
36 | + When I go to /profile/joaoaraujo/tags | ||
37 | + Then I should see "amazon" | ||
38 | + And I should not see "whales" | ||
39 | + | ||
40 | + Scenario: viewing profile's content tagged | ||
41 | + When I go to /profile/joaoaraujo/tags/amazon | ||
42 | + Then I should see "the Amazon is being destroyed" |
lib/noosfero.rb
1 | module Noosfero | 1 | module Noosfero |
2 | PROJECT = 'noosfero' | 2 | PROJECT = 'noosfero' |
3 | - VERSION = '0.24.0' | 3 | + VERSION = '0.24.1' |
4 | 4 | ||
5 | def self.pattern_for_controllers_in_directory(dir) | 5 | def self.pattern_for_controllers_in_directory(dir) |
6 | disjunction = controllers_in_directory(dir).join('|') | 6 | disjunction = controllers_in_directory(dir).join('|') |
public/designs/themes/base/style.css
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | 3 | ||
4 | .button { | 4 | .button { |
5 | -moz-border-radius: 3px; | 5 | -moz-border-radius: 3px; |
6 | + -webkit-border-radius: 3px; | ||
6 | } | 7 | } |
7 | 8 | ||
8 | #content input.button, #content a.button { | 9 | #content input.button, #content a.button { |
@@ -112,6 +113,7 @@ body, th, td, input { | @@ -112,6 +113,7 @@ body, th, td, input { | ||
112 | width: 160px; | 113 | width: 160px; |
113 | border: 1px solid #BBB; | 114 | border: 1px solid #BBB; |
114 | -moz-border-radius: 3px; | 115 | -moz-border-radius: 3px; |
116 | + -webkit-border-radius: 3px; | ||
115 | color: #CCC; | 117 | color: #CCC; |
116 | } | 118 | } |
117 | #user form.focused input { | 119 | #user form.focused input { |
@@ -555,11 +557,14 @@ div#notice { | @@ -555,11 +557,14 @@ div#notice { | ||
555 | background-color: #EEE; | 557 | background-color: #EEE; |
556 | background-position: 4px 50%; | 558 | background-position: 4px 50%; |
557 | -moz-border-radius: 4px; | 559 | -moz-border-radius: 4px; |
560 | + -webkit-border-radius: 4px; | ||
558 | } | 561 | } |
559 | 562 | ||
560 | #content .link-list-block li a.link-this-page { | 563 | #content .link-list-block li a.link-this-page { |
561 | -moz-border-radius-topright: 0px; | 564 | -moz-border-radius-topright: 0px; |
562 | -moz-border-radius-bottomright: 0px; | 565 | -moz-border-radius-bottomright: 0px; |
566 | + -webkit-border-radius-topright: 0px; | ||
567 | + -webkit-border-radius-bottomright: 0px; | ||
563 | background-color: #cecece; | 568 | background-color: #cecece; |
564 | max-width: 175px; | 569 | max-width: 175px; |
565 | width: 200px; | 570 | width: 200px; |
@@ -786,6 +791,7 @@ X.sep { | @@ -786,6 +791,7 @@ X.sep { | ||
786 | .controller-search #content .search_form { | 791 | .controller-search #content .search_form { |
787 | background: #DDD; | 792 | background: #DDD; |
788 | -moz-border-radius: 5px; | 793 | -moz-border-radius: 5px; |
794 | + -webkit-border-radius: 5px; | ||
789 | padding: 12px 15px 13px 15px; | 795 | padding: 12px 15px 13px 15px; |
790 | position: relative; | 796 | position: relative; |
791 | text-align: left; | 797 | text-align: left; |
@@ -813,6 +819,7 @@ X.sep { | @@ -813,6 +819,7 @@ X.sep { | ||
813 | .controller-search .search-options { | 819 | .controller-search .search-options { |
814 | border: 1px solid #777; | 820 | border: 1px solid #777; |
815 | -moz-border-radius: 5px; | 821 | -moz-border-radius: 5px; |
822 | + -webkit-border-radius: 5px; | ||
816 | } | 823 | } |
817 | .controller-search .search-options ul li { | 824 | .controller-search .search-options ul li { |
818 | position: relative; | 825 | position: relative; |
@@ -962,6 +969,7 @@ hr.pre-posts, hr.sep-posts { | @@ -962,6 +969,7 @@ hr.pre-posts, hr.sep-posts { | ||
962 | text-decoration: none; | 969 | text-decoration: none; |
963 | padding: 0px 2px; | 970 | padding: 0px 2px; |
964 | -moz-border-radius: 3px; | 971 | -moz-border-radius: 3px; |
972 | + -webkit-border-radius: 3px; | ||
965 | background: #BBB; | 973 | background: #BBB; |
966 | color: #FFF; | 974 | color: #FFF; |
967 | } | 975 | } |
@@ -984,6 +992,7 @@ hr.pre-posts, hr.sep-posts { | @@ -984,6 +992,7 @@ hr.pre-posts, hr.sep-posts { | ||
984 | 992 | ||
985 | .post_comment_box.closed h4 { | 993 | .post_comment_box.closed h4 { |
986 | -moz-border-radius: 4px; | 994 | -moz-border-radius: 4px; |
995 | + -webkit-border-radius: 4px; | ||
987 | } | 996 | } |
988 | 997 | ||
989 | .post_comment_box.opened h4 { | 998 | .post_comment_box.opened h4 { |
@@ -1119,6 +1128,7 @@ hr.pre-posts, hr.sep-posts { | @@ -1119,6 +1128,7 @@ hr.pre-posts, hr.sep-posts { | ||
1119 | .common-profile-list-block .vcard a:hover { | 1128 | .common-profile-list-block .vcard a:hover { |
1120 | border: 1px solid #CCC; | 1129 | border: 1px solid #CCC; |
1121 | -moz-border-radius: 5px; | 1130 | -moz-border-radius: 5px; |
1131 | + -webkit-border-radius: 5px; | ||
1122 | background: #EEE; | 1132 | background: #EEE; |
1123 | text-decoration: none; | 1133 | text-decoration: none; |
1124 | } | 1134 | } |
@@ -1137,6 +1147,7 @@ table.profile th { | @@ -1137,6 +1147,7 @@ table.profile th { | ||
1137 | background-color: #FFF; | 1147 | background-color: #FFF; |
1138 | border: 1px solid #EEE; | 1148 | border: 1px solid #EEE; |
1139 | -moz-border-radius: 9px; | 1149 | -moz-border-radius: 9px; |
1150 | + -webkit-border-radius: 9px; | ||
1140 | margin-bottom: 10px; | 1151 | margin-bottom: 10px; |
1141 | } | 1152 | } |
1142 | 1153 | ||
@@ -1149,6 +1160,7 @@ table.profile th { | @@ -1149,6 +1160,7 @@ table.profile th { | ||
1149 | border: 1px solid #CCC; | 1160 | border: 1px solid #CCC; |
1150 | background-color: #EEE; | 1161 | background-color: #EEE; |
1151 | -moz-border-radius: 4px; | 1162 | -moz-border-radius: 4px; |
1163 | + -webkit-border-radius: 4px; | ||
1152 | } | 1164 | } |
1153 | 1165 | ||
1154 | /************************** Control Panel ****************************/ | 1166 | /************************** Control Panel ****************************/ |
public/stylesheets/application.css
@@ -132,6 +132,7 @@ div#notice { | @@ -132,6 +132,7 @@ div#notice { | ||
132 | background-color: #000; | 132 | background-color: #000; |
133 | color: white; | 133 | color: white; |
134 | -moz-border-radius: 15px; | 134 | -moz-border-radius: 15px; |
135 | + -webkit-border-radius: 15px; | ||
135 | font-size: 16px; | 136 | font-size: 16px; |
136 | font-weight: bold; | 137 | font-weight: bold; |
137 | z-index: 100000; | 138 | z-index: 100000; |
@@ -454,6 +455,7 @@ div.pending-tasks { | @@ -454,6 +455,7 @@ div.pending-tasks { | ||
454 | #content #not-found, | 455 | #content #not-found, |
455 | #content #access-denied { | 456 | #content #access-denied { |
456 | -moz-border-radius: 6px; | 457 | -moz-border-radius: 6px; |
458 | + -webkit-border-radius: 6px; | ||
457 | } | 459 | } |
458 | 460 | ||
459 | #content #not-found p, | 461 | #content #not-found p, |
@@ -3100,6 +3102,7 @@ h1#agenda-title { | @@ -3100,6 +3102,7 @@ h1#agenda-title { | ||
3100 | .controller-profile_editor .control-panel a:hover { | 3102 | .controller-profile_editor .control-panel a:hover { |
3101 | background-color: #d2e0f0; | 3103 | background-color: #d2e0f0; |
3102 | -moz-border-radius: 3px; | 3104 | -moz-border-radius: 3px; |
3105 | + -webkit-border-radius: 3px; | ||
3103 | } | 3106 | } |
3104 | 3107 | ||
3105 | .controller-profile_editor a.control-panel-groups { background-image: url(../images/control-panel/system-users.png) } | 3108 | .controller-profile_editor a.control-panel-groups { background-image: url(../images/control-panel/system-users.png) } |
test/functional/content_viewer_controller_test.rb
@@ -251,11 +251,11 @@ class ContentViewerControllerTest < Test::Unit::TestCase | @@ -251,11 +251,11 @@ class ContentViewerControllerTest < Test::Unit::TestCase | ||
251 | get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ] | 251 | get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ] |
252 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { | 252 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { |
253 | :tag => 'a', | 253 | :tag => 'a', |
254 | - :attributes => { :href => "/profile/#{profile.identifier}/tag/tag1" } | 254 | + :attributes => { :href => "/profile/#{profile.identifier}/tags/tag1" } |
255 | } | 255 | } |
256 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { | 256 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { |
257 | :tag => 'a', | 257 | :tag => 'a', |
258 | - :attributes => { :href => "/profile/#{profile.identifier}/tag/tag2" } | 258 | + :attributes => { :href => "/profile/#{profile.identifier}/tags/tag2" } |
259 | } | 259 | } |
260 | 260 | ||
261 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ } | 261 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ } |
test/functional/profile_controller_test.rb
@@ -142,13 +142,13 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -142,13 +142,13 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
142 | should 'display tag for profile' do | 142 | should 'display tag for profile' do |
143 | @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') | 143 | @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') |
144 | 144 | ||
145 | - get :tag, :profile => @profile.identifier, :id => 'tag1' | 145 | + get :content_tagged, :profile => @profile.identifier, :id => 'tag1' |
146 | assert_tag :tag => 'a', :attributes => { :href => /testuser\/testarticle$/ } | 146 | assert_tag :tag => 'a', :attributes => { :href => /testuser\/testarticle$/ } |
147 | end | 147 | end |
148 | 148 | ||
149 | should 'link to the same tag but for whole environment' do | 149 | should 'link to the same tag but for whole environment' do |
150 | @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') | 150 | @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') |
151 | - get :tag, :profile => @profile.identifier, :id => 'tag1' | 151 | + get :content_tagged, :profile => @profile.identifier, :id => 'tag1' |
152 | 152 | ||
153 | assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site' | 153 | assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site' |
154 | end | 154 | end |
@@ -311,8 +311,8 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -311,8 +311,8 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
311 | Person.any_instance.stubs(:article_tags).returns({ 'one' => 1, 'two' => 2}) | 311 | Person.any_instance.stubs(:article_tags).returns({ 'one' => 1, 'two' => 2}) |
312 | get :tags, :profile => 'testuser' | 312 | get :tags, :profile => 'testuser' |
313 | 313 | ||
314 | - assert_tag :tag => 'div', :attributes => { :class => /main-block/ }, :descendant => { :tag => 'a', :attributes => { :href => '/profile/testuser/tag/one'} } | ||
315 | - assert_tag :tag => 'div', :attributes => { :class => /main-block/ }, :descendant => { :tag => 'a', :attributes => { :href => '/profile/testuser/tag/two'} } | 314 | + assert_tag :tag => 'div', :attributes => { :class => /main-block/ }, :descendant => { :tag => 'a', :attributes => { :href => '/profile/testuser/tags/one'} } |
315 | + assert_tag :tag => 'div', :attributes => { :class => /main-block/ }, :descendant => { :tag => 'a', :attributes => { :href => '/profile/testuser/tags/two'} } | ||
316 | end | 316 | end |
317 | 317 | ||
318 | should 'show e-mail for friends on profile page' do | 318 | should 'show e-mail for friends on profile page' do |
@@ -683,6 +683,19 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -683,6 +683,19 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
683 | assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person\'s description/ | 683 | assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person\'s description/ |
684 | end | 684 | end |
685 | 685 | ||
686 | + should 'not show description of orgarnization if not filled' do | ||
687 | + login_as(@profile.identifier) | ||
688 | + ent = fast_create(Enterprise) | ||
689 | + get :index, :profile => ent.identifier | ||
690 | + assert_no_tag :tag => 'div', :attributes => { :class => 'public-profile-description' } | ||
691 | + end | ||
692 | + | ||
693 | + should 'not show description of person if not filled' do | ||
694 | + login_as(@profile.identifier) | ||
695 | + get :index, :profile => @profile.identifier | ||
696 | + assert_no_tag :tag => 'div', :attributes => { :class => 'public-profile-description' } | ||
697 | + end | ||
698 | + | ||
686 | should 'ask for login if user not logged' do | 699 | should 'ask for login if user not logged' do |
687 | enterprise = fast_create(Enterprise) | 700 | enterprise = fast_create(Enterprise) |
688 | get :unblock, :profile => enterprise.identifier | 701 | get :unblock, :profile => enterprise.identifier |
test/integration/routing_test.rb
@@ -119,7 +119,7 @@ class RoutingTest < ActionController::IntegrationTest | @@ -119,7 +119,7 @@ class RoutingTest < ActionController::IntegrationTest | ||
119 | end | 119 | end |
120 | 120 | ||
121 | def test_profile_route_for_tags_with_dot | 121 | def test_profile_route_for_tags_with_dot |
122 | - assert_routing('/profile/ze/tag/tag.withdot', :controller => 'profile', :profile => 'ze', :action => 'tag', :id => 'tag.withdot') | 122 | + assert_routing('/profile/ze/tags/tag.withdot', :controller => 'profile', :profile => 'ze', :action => 'content_tagged', :id => 'tag.withdot') |
123 | end | 123 | end |
124 | 124 | ||
125 | def test_profile_with_tilde_routing | 125 | def test_profile_with_tilde_routing |
test/unit/tags_block_test.rb
@@ -22,9 +22,9 @@ class TagsBlockTest < Test::Unit::TestCase | @@ -22,9 +22,9 @@ class TagsBlockTest < Test::Unit::TestCase | ||
22 | end | 22 | end |
23 | 23 | ||
24 | should 'generate links to tags' do | 24 | should 'generate links to tags' do |
25 | - assert_match /profile\/testinguser\/tag\/first-tag/, block.content | ||
26 | - assert_match /profile\/testinguser\/tag\/second-tag/, block.content | ||
27 | - assert_match /profile\/testinguser\/tag\/third-tag/, block.content | 25 | + assert_match /profile\/testinguser\/tags\/first-tag/, block.content |
26 | + assert_match /profile\/testinguser\/tags\/second-tag/, block.content | ||
27 | + assert_match /profile\/testinguser\/tags\/third-tag/, block.content | ||
28 | end | 28 | end |
29 | 29 | ||
30 | should 'return (none) when no tags to display' do | 30 | should 'return (none) when no tags to display' do |
@@ -34,7 +34,7 @@ class TagsBlockTest < Test::Unit::TestCase | @@ -34,7 +34,7 @@ class TagsBlockTest < Test::Unit::TestCase | ||
34 | 34 | ||
35 | should 'generate links when profile has own hostname' do | 35 | should 'generate links when profile has own hostname' do |
36 | @user.domains << Domain.new(:name => 'testuser.net'); @user.save! | 36 | @user.domains << Domain.new(:name => 'testuser.net'); @user.save! |
37 | - assert_match /profile\/testinguser\/tag\/first-tag/, block.content | 37 | + assert_match /profile\/testinguser\/tags\/first-tag/, block.content |
38 | end | 38 | end |
39 | 39 | ||
40 | end | 40 | end |