attune 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attune/client.rb +2 -2
- data/lib/attune/version.rb +1 -1
- data/spec/attune/client_spec.rb +62 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e256a8b0669441065bf4b2d0b0d723afca73bbd
|
4
|
+
data.tar.gz: e746fab54b71d2d0c6ff0923f6bb397d7a9d27ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c0b6e93e0334c4e143e01662e4daf70b20c89b24b519b645008de9eb8e009fe12d7a2410a00ea03e95896649822f5b641a7e046791fe5d4fc5bd7823c8bc1db
|
7
|
+
data.tar.gz: 24e5d43a8d95fabb70b5200a3b58e3860c7f1742192d222f1698801722f6601b989ef3a88395ffa410b6e37cade38cd240c9a25ca40b44e727e91ae78a872b82
|
data/lib/attune/client.rb
CHANGED
@@ -127,7 +127,7 @@ module Attune
|
|
127
127
|
else
|
128
128
|
# In mock mode: return the entities in the order passed in
|
129
129
|
rankings[:headers] = {"attune-cell"=>"mock", "attune-ranking"=>"mock"}
|
130
|
-
rankings[:entities] = options[:entities]
|
130
|
+
rankings[:entities] = options[:entities].map(&:to_s)
|
131
131
|
end
|
132
132
|
rankings
|
133
133
|
end
|
@@ -175,7 +175,7 @@ module Attune
|
|
175
175
|
# In mock mode: return the entities in the order passed in
|
176
176
|
rankings[:headers] = {"attune-cell"=>"mock", "attune-ranking"=>"mock"}
|
177
177
|
rankings[:entities] = multi_options.map do |options|
|
178
|
-
options[:entities]
|
178
|
+
options[:entities].map(&:to_s)
|
179
179
|
end
|
180
180
|
end
|
181
181
|
rankings
|
data/lib/attune/version.rb
CHANGED
data/spec/attune/client_spec.rb
CHANGED
@@ -73,31 +73,69 @@ describe Attune::Client do
|
|
73
73
|
result = client.create_anonymous(user_agent: 'Mozilla/5.0')
|
74
74
|
expect(result).to match(/^[a-z0-9\-]+$/)
|
75
75
|
end
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
76
|
+
describe "mocks get_rankings" do
|
77
|
+
let(:entities) { %w[1001 1002 1003 1004] }
|
78
|
+
let(:expected) do
|
79
|
+
{
|
80
|
+
headers: {"attune-cell"=>"mock", "attune-ranking"=>"mock"},
|
81
|
+
entities: entities.map { |e| e.to_s }
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
before(:each) do
|
86
|
+
@result = client.get_rankings(
|
87
|
+
id: 'abcd123',
|
88
|
+
view: 'b/mens-pants',
|
89
|
+
collection: 'products',
|
90
|
+
entities: entities
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
context "with entities sent as strings" do
|
95
|
+
it "returns entities in order sent" do
|
96
|
+
expect(@result).to eq expected
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
context "with entities sent as integers" do
|
101
|
+
let(:entities) { [1001, 1002, 1003, 1004] }
|
102
|
+
|
103
|
+
it "returns entities in order sent as strings" do
|
104
|
+
expect(@result).to eq expected
|
105
|
+
end
|
106
|
+
end
|
88
107
|
end
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
108
|
+
describe "mocks multi_get_rankings" do
|
109
|
+
let(:entities) { %w[1001 1002 1003 1004] }
|
110
|
+
let(:expected) do
|
111
|
+
{
|
112
|
+
headers: {"attune-cell"=>"mock", "attune-ranking"=>"mock"},
|
113
|
+
entities: [ entities.map { |e| e.to_s } ]
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
before(:each) do
|
118
|
+
@result = client.multi_get_rankings([
|
119
|
+
id: 'abcd123',
|
120
|
+
view: 'b/mens-pants',
|
121
|
+
collection: 'products',
|
122
|
+
entities: entities
|
123
|
+
])
|
124
|
+
end
|
125
|
+
|
126
|
+
context "with entities sent as strings" do
|
127
|
+
it "returns entities in order sent" do
|
128
|
+
expect(@result).to eq expected
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context "with entities sent as integers" do
|
133
|
+
let(:entities) { [1001, 1002, 1003, 1004] }
|
134
|
+
|
135
|
+
it "returns entities in order sent as strings" do
|
136
|
+
expect(@result).to eq expected
|
137
|
+
end
|
138
|
+
end
|
101
139
|
end
|
102
140
|
end
|
103
141
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|