Sha256: 4384a48a1b57346c568c2151ef2b383359615a24372c8015f4babb33923c7d32
Contents?: true
Size: 871 Bytes
Versions: 12
Compression:
Stored size: 871 Bytes
Contents
require 'spec_helper' describe ActiveAdmin::ResourceController::Collection do let(:params) do {} end let(:controller) do rc = Admin::PostsController.new rc.stub!(:params) do params end rc end describe ActiveAdmin::ResourceController::Collection::Search do let(:params){ {:q => {} }} it "should call the metasearch method" do chain = mock("ChainObj") chain.should_receive(:metasearch).with(params[:q]).once.and_return(Post.search) controller.send :search, chain end end describe ActiveAdmin::ResourceController::Collection::Sorting do let(:params){ {:order => "id_asc" }} it "should prepend the table name" do chain = mock("ChainObj") chain.should_receive(:order).with("\"posts\".id asc").once.and_return(Post.search) controller.send :sort_order, chain end end end
Version data entries
12 entries across 12 versions & 3 rubygems