fix pool controller tests

This commit is contained in:
albert
2011-07-22 18:15:43 -04:00
parent d0e8084f0f
commit c74fa18898
12 changed files with 33 additions and 98 deletions

View File

@@ -10,7 +10,7 @@ class PostAppealsController < ApplicationController
def index
@search = PostAppeal.search(params[:search])
@post_appeals = @search.paginate(:page => params[:page])
@post_appeals = @search.paginate(params[:page])
end
def create

View File

@@ -10,7 +10,7 @@ class PostFlagsController < ApplicationController
def index
@search = PostFlag.search(params[:search])
@post_flags = @search.paginate(:page => params[:page])
@post_flags = @search.paginate(params[:page])
end
def create

View File

@@ -9,6 +9,6 @@ module PostVotesHelper
added = current.post_id_array - prev.post_id_array
removed = prev.post_id_array - current.post_id_array
added.map {|x| '<ins>+<a href="/posts/' + x + '">' + x + '</a></ins>'}.join(" ") + removed.map {|x| '<del>&ndash;<a href="/posts/' + x + '">' + x + '</a></del>'}.join(" ")
added.map {|x| '<ins>+<a href="/posts/' + x.to_s + '">' + x.to_s + '</a></ins>'}.join(" ") + removed.map {|x| '<del>&ndash;<a href="/posts/' + x.to_s + '">' + x.to_s + '</a></del>'}.join(" ")
end
end

View File

@@ -3,6 +3,7 @@ class PoolVersion < ActiveRecord::Base
validates_presence_of :updater_id, :updater_ip_addr
belongs_to :pool
belongs_to :updater, :class_name => "User"
before_validation :initialize_updater
def initialize_updater

View File

@@ -44,7 +44,6 @@
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
<% if CurrentUser.is_janitor? %>
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
<%= nav_link_to("Queue", moderator_post_dashboard_path) %>
<% end %>
<%= nav_link_to("&raquo;".html_safe, site_map_path) %>
</menu>

View File

@@ -1,10 +1,11 @@
<div id="c-pools">
<div id="a-index">
<h3>Pool History: <%= @pool_version.name %></h3>
<h3>Pool History</h3>
<table width="100%">
<thead>
<tr>
<th>Pool</th>
<th>Post Count</th>
<th>Changes</th>
<th>Updater</th>
@@ -16,7 +17,8 @@
<tbody>
<% @pool_versions.each do |pool_version| %>
<tr>
<td><%= link_to pool_version.post_id_array.size, pool_version_path(pool_version) %></td>
<td><%= pool_version.pool.name %></td>
<td><%= link_to pool_version.post_id_array.size, pool_versions_path(pool_version) %></td>
<td><%= pool_version_diff(pool_version) %></td>
<td><%= link_to pool_version.updater.name, user_path(pool_version.updater) %></td>
<td>
@@ -30,11 +32,11 @@
<% end %>
</tbody>
</table>
<div class="paginator">
<%= numbered_paginator(@pool_versions) %>
</div>
</div>
</div>
<div id="paginator">
<%= sequential_paginator(@pool_versions) %>
</div>
<%= render :partial => "pools/secondary_links" %>

View File

@@ -10,7 +10,7 @@
<% end %>
<li><%= link_to "Changes", post_versions_path %></li>
<li>Approvals</li>
<li><%= link_to "Moderate", moderation_post_dashboard_path %></li>
<li><%= link_to "Moderate", moderator_post_dashboard_path %></li>
<li>Help</li>
</menu>
<% end %>