Skip to content

Commit

Permalink
Add specs for default number of perpage items for saved reports
Browse files Browse the repository at this point in the history
  • Loading branch information
PanSpagetka committed Oct 15, 2018
1 parent fb2ae5a commit 5ca4233
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/controllers/application_controller/report_data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@
expect(controller).to receive(:view_to_hash)
controller.report_data
end

it "should have default number of perpage records set for reports" do
controller.instance_variable_set(:@_params, :model_name => "MiqReportResult")
allow(controller).to receive(:settings_default).with(10, :perpage, :reports).and_return(5)
report_data = JSON.parse(controller.report_data)
expect(report_data["settings"]["perpage"]).to eql(5)
end
end
end

0 comments on commit 5ca4233

Please sign in to comment.