Add new charts and a segmented control to the Stats page
This commit is contained in:
parent
9dc4901294
commit
52ea4a1b8d
5 changed files with 122 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue