Skip to content

Commit

Permalink
Merge pull request #2674 from jonduarte/improve-statistics-specs
Browse files Browse the repository at this point in the history
Ensure dashboard/statistics is being fully tested
  • Loading branch information
mshibuya committed Jul 22, 2016
2 parents 67af62a + aeb252e commit 4ef5be4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/controllers/rails_admin/main_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ def get(action, params)
end

it 'shows statistics by default' do
expect(RailsAdmin.config(Player).abstract_model).to receive(:count).and_return(0)
allow(RailsAdmin.config(Player).abstract_model).to receive(:count).and_return(0)
expect(RailsAdmin.config(Player).abstract_model).to receive(:count)
controller.dashboard
end

it 'does not show statistics if turned off' do
RailsAdmin.config do |c|
c.included_models = [Player]
c.actions do
dashboard do
statistics false
end
index # mandatory
end
end

Expand Down

0 comments on commit 4ef5be4

Please sign in to comment.