diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 56505c3..b4da66d 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -223,10 +223,10 @@ class SearchController < PublicController end def tag - @tag = environment.tags.find_by_name(params[:tag]) + @tag = params[:tag] @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_env_#{environment.id.to_s}_page_#{params[:npage]}" if is_cache_expired?(@tag_cache_key, true) - @tagged = environment.articles.find_tagged_with(@tag.name).paginate(:per_page => 10, :page => params[:npage]) + @tagged = environment.articles.find_tagged_with(@tag).paginate(:per_page => 10, :page => params[:npage]) end end diff --git a/features/tags.feature b/features/tags.feature index 30f7e94..afe324f 100644 --- a/features/tags.feature +++ b/features/tags.feature @@ -40,3 +40,7 @@ Feature: tags Scenario: viewing profile's content tagged When I go to /profile/joaoaraujo/tags/amazon Then I should see "the Amazon is being destroyed" + + Scenario: trying to view a tag not used + When I go to /tag/shark + Then I should see /Tagged with "shark"/ -- libgit2 0.21.2