test fxies
This commit is contained in:
@@ -11,7 +11,7 @@ class BansController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = Ban.search(params[:search])
|
||||
@bans = @search.paginate(:page => params[:page])
|
||||
@bans = @search.paginate(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -15,7 +15,7 @@ class DmailsController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = Dmail.search(params[:search])
|
||||
@dmails = @search.paginate(:page => params[:page])
|
||||
@dmails = @search.paginate(params[:page])
|
||||
@dmails.each {|x| check_privilege(x)}
|
||||
respond_with(@dmails)
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class IpBansController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = IpBan.search(params[:search])
|
||||
@ip_bans = @search.paginate(:page => params[:page])
|
||||
@ip_bans = @search.paginate(params[:page])
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
@@ -13,7 +13,7 @@ class JanitorTrialsController < ApplicationController
|
||||
|
||||
def index
|
||||
@search = JanitorTrial.search(params[:search])
|
||||
@janitor_trials = @search.paginate(:page => params[:page])
|
||||
@janitor_trials = @search.paginate(params[:page])
|
||||
respond_with(@janitor_trials)
|
||||
end
|
||||
|
||||
|
||||
@@ -16,12 +16,15 @@ class NoteVersionsControllerTest < ActionController::TestCase
|
||||
context "index action" do
|
||||
setup do
|
||||
@note = Factory.create(:note)
|
||||
CurrentUser.id = 20
|
||||
@note.body = "1 2"
|
||||
@note.create_version
|
||||
CurrentUser.id = 30
|
||||
@note.body = "1 2 3"
|
||||
@note.create_version
|
||||
@user_2 = Factory.create(:user)
|
||||
|
||||
CurrentUser.scoped(@user_2, "1.2.3.4") do
|
||||
@note.update_attributes(:body => "1 2")
|
||||
end
|
||||
|
||||
CurrentUser.scoped(@user, "1.2.3.4") do
|
||||
@note.update_attributes(:body => "1 2 3")
|
||||
end
|
||||
end
|
||||
|
||||
should "list all versions" do
|
||||
@@ -32,7 +35,7 @@ class NoteVersionsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
should "list all versions that match the search criteria" do
|
||||
get :index, {:search => {:updater_id_equals => "20"}}
|
||||
get :index, {:search => {:updater_id_equals => @user_2.id}}
|
||||
assert_response :success
|
||||
assert_not_nil(assigns(:note_versions))
|
||||
assert_equal(1, assigns(:note_versions).size)
|
||||
|
||||
Reference in New Issue
Block a user