Mock Kaminari paginates_per instead of setting it

This commit is contained in:
Matija Čupić 2017-12-05 16:20:24 +01:00
parent 4d75901c02
commit 2eb41b5a42
No known key found for this signature in database
GPG key ID: 4BAF84FFACD2E5DE

View file

@ -38,7 +38,7 @@ describe Projects::ClustersController do
let(:last_page) { project.clusters.page.total_pages }
before do
Clusters::Cluster.paginates_per(1)
allow(Clusters::Cluster).to receive(:paginates_per).and_return(1)
create_list(:cluster, 2, :provided_by_gcp, projects: [project])
get :index, namespace_id: project.namespace, project_id: project, page: last_page
end