How to test paginate


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.login,
users.first_name, users.last_name,,users.activation_code,role_relations.role_id,
role_relations.customer_id, AS role_name”, :joins => “LEFT
JOIN role_relations ON role_relations.user_id = LEFT JOIN roles
ON = 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