Introduction
Introduction Statistics Contact Development Disclaimer Help
removed some specs that put expectation on internel stuff, making every minor c…
Log
Files
Refs
README
---
commit bbec0de4cda48704427b6978a4d8080edf5d3a2d
parent 1d937aa19e87ee6eaa80c8683bc8cf98df0d008b
Author: Marco Otte-Witte <[email protected]>
Date: Wed, 29 Apr 2009 10:35:17 +0200
removed some specs that put expectation on internel stuff, making every minor c…
Diffstat:
M spec/classes/cumulated_report_spec… | 35 ---------------------------…
M spec/classes/report_cache_spec.rb | 16 ----------------
M spec/classes/report_spec.rb | 43 ------------------------------
3 files changed, 0 insertions(+), 94 deletions(-)
---
diff --git a/spec/classes/cumulated_report_spec.rb b/spec/classes/cumulated_rep…
@@ -26,41 +26,6 @@ describe Simplabs::ReportsAsSparkline::CumulatedReport do
@report.run.length.should == 11
end
- describe "a month report with a limit of 2" do
- before(:all) do
- User.delete_all
- User.create!(:login => 'test 1', :created_at => Time.now, :p…
- User.create!(:login => 'test 2', :created_at => Time.now - 1.month, :p…
- User.create!(:login => 'test 3', :created_at => Time.now - 3.month, :p…
- User.create!(:login => 'test 4', :created_at => Time.now - 3.month, :p…
- User.create!(:login => 'test 5', :created_at => Time.now - 4.month, :p…
-
- @report2 = Simplabs::ReportsAsSparkline::CumulatedReport.new(User, :cu…
- :grouping => :month,
- :limit => 2
- )
-
- @one_month_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- @two_months_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- @three_months_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- end
-
- it 'should include the counts from before the first period in the cumula…
- @report2.run.should == [[@two_months_ago, 3.0], [@one_month_ago, 4.0]]
- end
-
- it 'should return the initial count for initial_cumulative_value' do
- options = @report2.send(:options_for_run, {})
- tomorrow = 1.day.from_now
- @report2.send(:initial_cumulative_value, tomorrow, options)…
- @report2.send(:initial_cumulative_value, tomorrow - 1.month, options)…
- @report2.send(:initial_cumulative_value, tomorrow - 2.months, options)…
- @report2.send(:initial_cumulative_value, tomorrow - 3.months, options)…
- @report2.send(:initial_cumulative_value, tomorrow - 4.months, options)…
- @report2.send(:initial_cumulative_value, tomorrow - 5.months, options)…
- end
- end
-
for grouping in [:hour, :day, :week, :month] do
describe "for grouping #{grouping.to_s}" do
diff --git a/spec/classes/report_cache_spec.rb b/spec/classes/report_cache_spec…
@@ -155,16 +155,6 @@ describe Simplabs::ReportsAsSparkline::ReportCache do
Simplabs::ReportsAsSparkline::ReportCache.process(@report, { :limit => 1…
end
- it 'should prepare the results before it returns them' do
- new_after_cache_data = []
- new_before_cache_data = []
- cached_data = []
- Simplabs::ReportsAsSparkline::ReportCache.stub!(:find).and_return(cached…
- Simplabs::ReportsAsSparkline::ReportCache.should_receive(:prepare_result…
-
- Simplabs::ReportsAsSparkline::ReportCache.process(@report, @report.optio…
- end
-
it 'should yield the first reporting period if the cache is empty' do
Simplabs::ReportsAsSparkline::ReportCache.process(@report, @report.optio…
begin_at.should == Simplabs::ReportsAsSparkline::ReportingPeriod.first…
@@ -204,12 +194,6 @@ describe Simplabs::ReportsAsSparkline::ReportCache do
Simplabs::ReportsAsSparkline::ReportCache.stub!(:build_cached_data).and_…
end
- it 'should convert the date strings from the newly read data to reporting …
- Simplabs::ReportsAsSparkline::ReportingPeriod.should_receive(:from_db_st…
-
- Simplabs::ReportsAsSparkline::ReportCache.send(:prepare_result, [], @new…
- end
-
it 'should create :limit instances of Simplabs::ReportsAsSparkline::Report…
Simplabs::ReportsAsSparkline::ReportCache.should_receive(:build_cached_d…
@report,
diff --git a/spec/classes/report_spec.rb b/spec/classes/report_spec.rb
@@ -68,49 +68,6 @@ describe Simplabs::ReportsAsSparkline::Report do
@report.run.length.should == 11
end
- describe "a month report with a limit of 2" do
- before(:all) do
- User.create!(:login => 'test 1', :created_at => Time.now, :p…
- User.create!(:login => 'test 2', :created_at => Time.now - 1.month, :p…
- User.create!(:login => 'test 3', :created_at => Time.now - 3.month, :p…
- User.create!(:login => 'test 4', :created_at => Time.now - 3.month, :p…
-
- @report2 = Simplabs::ReportsAsSparkline::Report.new(User, :registratio…
- :grouping => :month,
- :limit => 2
- )
-
- @one_month_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- @two_months_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- @three_months_ago = Date.new(DateTime.now.year, DateTime.now.month, 1)…
- end
-
- it "should return data for the last two months when there is no end date…
- @report2.run.should == [[@two_months_ago, 0.0], [@one_month_ago, 1.0]]
- end
-
- it "should go back further into history on a second report run if the li…
- @report2.run(:limit => 2)
- @report2.run(:limit => 3).should == [[@three_months_ago, 2.0], [@two_m…
- end
-
- it "should return data for two months prior to the end date" do
- @report2.run(:end_date => 1.month.ago).should == [[@three_months_ago, …
- end
-
- it "should return data for the two months prior to the end date, and als…
- @report2.run(:end_date => 1.month.ago, :live_data => true).should == […
- end
-
- it "should return data for the two months prior to the end date, and als…
- # run it once to get from the database...
- @report2.run(:end_date => 1.month.ago, :live_data => true)
-
- # and then again from the cache...
- @report2.run(:end_date => 1.month.ago, :live_data => true).should == […
- end
- end
-
for grouping in [:hour, :day, :week, :month] do
describe "for grouping #{grouping.to_s}" do
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.