embark-journey 0.0.29 → 0.1.0

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: 682ec526295c2a46036e0c2abcaa6bf168858d82
4
- data.tar.gz: a6fe8cb59c20f5f6176bae2f6603f86c1d25533f
3
+ metadata.gz: 1b89e8bfb66ca4c4f356545376aef856f05f56b6
4
+ data.tar.gz: c06e140222c70b4b2565f754c8ec18e737cfe1d0
5
5
  SHA512:
6
- metadata.gz: 66ec3d2cd6f012433c946b427fbbb1cbabf21e5d03bd391ef9be40b7aa2791e900fcbe328d528f3a8294bac84f9451bf9a8bb757342728ce9cff64f516d9a9b1
7
- data.tar.gz: 6402734a0ec6526072607c5501984b417490d00f65622b6b6a3887adea5f547f7aad59226dc49b7f3073bf723849c186cf05ec80771f781cd060b14ae6d708ab
6
+ metadata.gz: b30f45baab6f77c47c0acb08796d4dc38758db834b43beb159cc4bffdb768723d81bf54b62fa34157e5bd6fe33e83b7197c047a7a6ff21a6c1e407db78f9db86
7
+ data.tar.gz: fbcf3ed97258b645618e9d8723d4cd34215ccb7827f4544a4ecf02de07b9cb64205b13b7b222b0a36b60842c6ec91f30828e5636059bb286b83e310f2f4f364a
@@ -21,7 +21,7 @@ module Journey::Resource::WhereMultiple
21
21
  end.map(&:to_a).sum
22
22
 
23
23
  else
24
- where(clauses)
24
+ where(clauses.merge(query: query))
25
25
  end
26
26
  end
27
27
  end
@@ -1,8 +1,8 @@
1
1
  module Journey
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 0
5
- TINY = 29
4
+ MINOR = 1
5
+ TINY = 0
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
8
8
  end
@@ -15,7 +15,7 @@ describe Journey::Resource::WhereMultiple do
15
15
 
16
16
  before { klass.destroy_all }
17
17
 
18
- let(:candidates) { matchables + unmatchables }
18
+ let!(:candidates) { matchables + unmatchables }
19
19
 
20
20
  context "when query doesn't contain any key having an array-like value" do
21
21
  let(:matchables) do
@@ -25,7 +25,7 @@ describe Journey::Resource::WhereMultiple do
25
25
  [ klass.create(number: 'X') ]
26
26
  end
27
27
 
28
- let(:collection) { klass.where_multiple(query: { number: 'A' }) }
28
+ let!(:collection) { klass.where_multiple(query: { number: 'A' }) }
29
29
 
30
30
  it 'returns correct results' do
31
31
  expect(matchables).to be_all do |matchable|
@@ -39,6 +39,35 @@ describe Journey::Resource::WhereMultiple do
39
39
  pending 'performs 1 query'
40
40
  end
41
41
 
42
+ context "when query contains a key with the value of an array containing a single item" do
43
+
44
+ let(:matchables) do
45
+ [
46
+ klass.create(number: 'A')
47
+ ]
48
+ end
49
+ let(:unmatchables) do
50
+ [
51
+ klass.create(number: 'B')
52
+ ]
53
+ end
54
+
55
+ let!(:collection) { klass.where_multiple(query: { number: ['A'] }, sort: { number: :desc }) }
56
+
57
+ it 'returns correct results' do
58
+ collection
59
+ expect(matchables).to be_all do |matchable|
60
+ collection.include?(matchable)
61
+ end
62
+ expect(unmatchables).not_to be_any do |unmatchable|
63
+ collection.include?(unmatchable)
64
+ end
65
+ end
66
+
67
+ pending 'performs n queries'
68
+
69
+ end
70
+
42
71
  context "when query contains one key having an array-like value" do
43
72
 
44
73
  let(:matchables) do
@@ -54,7 +83,7 @@ describe Journey::Resource::WhereMultiple do
54
83
  ]
55
84
  end
56
85
 
57
- let(:collection) { klass.where_multiple(query: { number: ['A', 'B'] }) }
86
+ let!(:collection) { klass.where_multiple(query: { number: ['A', 'B'] }) }
58
87
 
59
88
  it 'returns correct results' do
60
89
  expect(matchables).to be_all do |matchable|
@@ -88,7 +117,7 @@ describe Journey::Resource::WhereMultiple do
88
117
  ]
89
118
  end
90
119
 
91
- let(:collection) { klass.where_multiple(query: { number: ['A', 'B'], flash_number: ['1', '2'] }) }
120
+ let!(:collection) { klass.where_multiple(query: { number: ['A', 'B'], flash_number: ['1', '2'] }) }
92
121
 
93
122
  it 'returns correct results' do
94
123
  expect(matchables).to be_all do |matchable|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embark-journey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Davey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-18 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_attr