How to test paginate

hii

i am initial level of rspec.i have no idea that how to test paginate method in rspec

My controller code is

@sort = params[:sort] ? params[:sort] : "users.created_at"     @by = params[:by] ? params[:by] : "ASC"

@users = User.paginate(:select => "users.id, users.login, users.first_name, users.last_name, users.email,users.activation_code,role_relations.role_id, role_relations.customer_id, roles.name AS role_name", :joins => "LEFT JOIN role_relations ON role_relations.user_id = users.id LEFT JOIN roles ON roles.id = role_relations.role_id", :conditions => ["role_relations.customer_id = #{params[:customer_id]}"], :order => @sort+" "+@by, :page => params[:page], :per_page => session[:per_page])

i have searched on google but I could not find the solution

Please anyone post the solution of this problem