<span class='badge count-number'><%= number_with_delimiter(current_user.diary_entries.size) %></span>
</li>
<li>
- <%= link_to t(".my comments"), diary_comments_path(current_user) %>
+ <%= link_to t(".my comments"), user_diary_comments_path(current_user) %>
<span class='badge count-number'><%= number_with_delimiter(current_user.diary_comments.size) %></span>
</li>
<li>
<span class='badge count-number'><%= number_with_delimiter(@user.diary_entries.size) %></span>
</li>
<li>
- <%= link_to t(".comments"), diary_comments_path(@user) %>
+ <%= link_to t(".comments"), user_diary_comments_path(@user) %>
<span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
</li>
<% if current_user %>
get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
get "/user/:display_name/diary/comments/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/diary/comments")
- get "/user/:display_name/diary/comments" => "diary_comments#index", :as => :diary_comments
+ get "/user/:display_name/diary/comments" => "diary_comments#index", :as => :user_diary_comments
get "/user/:display_name/diary" => "diary_entries#index"
get "/diary/:language" => "diary_entries#index"
scope "/user/:display_name" do
deleted_user = create(:user, :deleted)
# Test a user with no comments
- get diary_comments_path(user)
+ get user_diary_comments_path(user)
assert_response :success
assert_template :index
assert_select "h4", :html => "No diary comments"
# Test a user with a comment
create(:diary_comment, :user => other_user)
- get diary_comments_path(other_user)
+ get user_diary_comments_path(other_user)
assert_response :success
assert_template :index
assert_dom "a[href='#{user_path(other_user)}']", :text => other_user.display_name
end
# Test a suspended user
- get diary_comments_path(suspended_user)
+ get user_diary_comments_path(suspended_user)
assert_response :not_found
# Test a deleted user
- get diary_comments_path(deleted_user)
+ get user_diary_comments_path(deleted_user)
assert_response :not_found
end
user = create(:user)
%w[-1 0 fred].each do |id|
- get diary_comments_path(user, :before => id)
+ get user_diary_comments_path(user, :before => id)
assert_redirected_to :controller => :errors, :action => :bad_request
- get diary_comments_path(user, :after => id)
+ get user_diary_comments_path(user, :after => id)
assert_redirected_to :controller => :errors, :action => :bad_request
end
end