Add new charts and a segmented control to the Stats page

This commit is contained in:
gregoirenovel 2017-03-28 15:42:48 +02:00
parent 9dc4901294
commit 52ea4a1b8d
5 changed files with 122 additions and 5 deletions

View file

@ -23,4 +23,21 @@ describe StatsController, type: :controller do
it { expect(subject).to eq(@expected_hash) }
end
describe '#cumulative_hash' do
before do
FactoryGirl.create(:procedure, :created_at => 45.days.ago)
FactoryGirl.create(:procedure, :created_at => 15.days.ago)
FactoryGirl.create(:procedure, :created_at => 15.days.ago)
end
let (:association) { Procedure.all }
subject { StatsController.new.send(:cumulative_hash, association) }
it { expect(subject).to eq({
45.days.ago.beginning_of_month => 1,
15.days.ago.beginning_of_month => 3
}) }
end
end