Move a test in the right describe section
This commit is contained in:
parent
84cf52d1a5
commit
b820f9d39c
1 changed files with 15 additions and 15 deletions
|
@ -66,22 +66,22 @@ describe StatsController, type: :controller do
|
|||
15.days.ago.beginning_of_month => 3
|
||||
}) }
|
||||
end
|
||||
end
|
||||
|
||||
context "with a date attribute" do
|
||||
before do
|
||||
FactoryGirl.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago)
|
||||
FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 20.days.ago)
|
||||
FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 10.days.ago)
|
||||
context "with a date attribute" do
|
||||
before do
|
||||
FactoryGirl.create(:procedure, :created_at => 45.days.ago, :updated_at => 20.days.ago)
|
||||
FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 20.days.ago)
|
||||
FactoryGirl.create(:procedure, :created_at => 15.days.ago, :updated_at => 10.days.ago)
|
||||
end
|
||||
|
||||
let (:association) { Procedure.all }
|
||||
|
||||
subject { StatsController.new.send(:cumulative_hash, association, :updated_at) }
|
||||
|
||||
it { expect(subject).to eq({
|
||||
20.days.ago.beginning_of_month => 2,
|
||||
10.days.ago.beginning_of_month => 3
|
||||
}) }
|
||||
end
|
||||
|
||||
let (:association) { Procedure.all }
|
||||
|
||||
subject { StatsController.new.send(:cumulative_hash, association, :updated_at) }
|
||||
|
||||
it { expect(subject).to eq({
|
||||
20.days.ago.beginning_of_month => 2,
|
||||
10.days.ago.beginning_of_month => 3
|
||||
}) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue