ar_aggregate_by_interval 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60d194e4f1346228225b37d2c176e1699da97d01
4
- data.tar.gz: 82aead17f908b020f50909b1589cc9a500233dfa
3
+ metadata.gz: e1c961b3ed5d12203cc873a4594870eb7408f5a4
4
+ data.tar.gz: 0d3bd079ac028864d66b4b69f4908686dff8cf47
5
5
  SHA512:
6
- metadata.gz: 123c5a51bb2c75d8a60628b20d46dae8b28e3c0b52ef62ae504cf3c4038a6f600ebe98c79ad337fcd0799e83b8e066c346148e75bb2c5ef64272720a6f9f523f
7
- data.tar.gz: 13c5c11f9575481558e9d97e0dabbf320a45ed44efa43e512b68f899257b96efc3a7166ac5aa54b3ef8789aaa5e7eba79ed6793314bc84a6b32b32347bad46bd
6
+ metadata.gz: de4dc421547761903a03d2f2a2d7c20e83dfe702fe1364ed08628ed11ad10d9ac457f3ae554ef90b09ae72dde382b4507042e04654579135f9dc6054c836c057
7
+ data.tar.gz: 2bf2561984d1adde9aeaad18e99191726d372525aa01ba0f192e58d0ceb219bcecd844ca1673e85349772f192457326480229b5ca0c2ba01d478b10b86041f04
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This file adheres to [Keep a changelog](http://keepachangelog.com/).
5
5
 
6
+ ## [1.1.7] - 2015-03-15 (maintenance)
7
+ ### Added
8
+ - Tests for from and to parameters
9
+
6
10
  ## [1.1.6] - 2015-03-15 (maintenance)
7
11
  ### Added
8
12
  - Tests run on MySQL, Postgres and SQLite
@@ -1,3 +1,3 @@
1
1
  module ArAggregateByInterval
2
- VERSION = '1.1.6'
2
+ VERSION = '1.1.7'
3
3
  end
@@ -16,6 +16,11 @@ describe ArAggregateByInterval do
16
16
  @to = @from
17
17
  blog1 = Blog.create! arbitrary_number: 10, created_at: @from
18
18
  blog2 = Blog.create! arbitrary_number: 20, created_at: @from
19
+
20
+ # extra row that should not be included in any of the calculations
21
+ # verifying that the from and to parameters are working
22
+ blog3 = Blog.create! arbitrary_number: 20, created_at: (@from + 2.week)
23
+
19
24
  blog1.page_views.create! date: @from
20
25
  blog1.page_views.create! date: @from
21
26
  end
@@ -106,6 +111,25 @@ describe ArAggregateByInterval do
106
111
  end
107
112
 
108
113
  context 'normal args' do
114
+
115
+ context 'with to' do
116
+ subject do
117
+ Blog.count_weekly(:created_at, @from, @from)
118
+ end
119
+ it "returns only 1 results on #{db_config}" do
120
+ expect(subject.values.size).to eq 1
121
+ end
122
+ end
123
+
124
+ context 'without to, defaults to Time.now' do
125
+ subject do
126
+ Blog.count_weekly(:created_at, @from)
127
+ end
128
+ it "returns more than 1 result on #{db_config}" do
129
+ expect(subject.values.size).to be > 1
130
+ end
131
+ end
132
+
109
133
  context 'for count' do
110
134
  subject do
111
135
  Blog.count_weekly(:created_at, @from, @from)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_aggregate_by_interval
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Otto