koko-ai-ruby 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +5 -0
- data/lib/koko/tracker/client.rb +3 -3
- data/lib/koko/tracker/version.rb +1 -1
- data/spec/koko/tracking/client_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7718b43091569d38e26692700e0b3dddfb6a9e1d
|
4
|
+
data.tar.gz: b2e48ee20b1f5e83c8c994f00103f239783d8e4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f304d49508b43648afea8b7e9050e8adee18de2a0b8b7329e6c7123c910194de1e50351c282cee9ba6c6c8ac39c70ee8566a4d0c97367894ad7d011f0c6d1dd
|
7
|
+
data.tar.gz: b8f11cae45d881d64c86fc489b877d1d3b3f65634707806f7deaca922a2e23b9f1498dc99bbf0a3d81624c182504f78d6422f4d1412b3df8f322be72a3e3305b
|
data/History.md
CHANGED
data/lib/koko/tracker/client.rb
CHANGED
@@ -30,7 +30,7 @@ module Koko
|
|
30
30
|
|
31
31
|
timestamp = attrs[:created_at] || Time.now
|
32
32
|
check_timestamp! timestamp
|
33
|
-
attrs[:created_at] = timestamp
|
33
|
+
attrs[:created_at] = timestamp.iso8601
|
34
34
|
|
35
35
|
handle_response(Request.new(path: '/track/content').post(@auth, attrs)).body
|
36
36
|
end
|
@@ -43,7 +43,7 @@ module Koko
|
|
43
43
|
|
44
44
|
timestamp = attrs[:created_at] || Time.now
|
45
45
|
check_timestamp! timestamp
|
46
|
-
attrs[:created_at] = timestamp
|
46
|
+
attrs[:created_at] = timestamp.iso8601
|
47
47
|
|
48
48
|
handle_response(Request.new(path: '/track/flag').post(@auth, attrs)).body
|
49
49
|
end
|
@@ -56,7 +56,7 @@ module Koko
|
|
56
56
|
|
57
57
|
timestamp = attrs[:created_at] || Time.now
|
58
58
|
check_timestamp! timestamp
|
59
|
-
attrs[:created_at] = timestamp
|
59
|
+
attrs[:created_at] = timestamp.iso8601
|
60
60
|
|
61
61
|
handle_response(Request.new(path: '/track/moderation').post(@auth, attrs)).body
|
62
62
|
end
|
data/lib/koko/tracker/version.rb
CHANGED
@@ -52,14 +52,14 @@ module Koko
|
|
52
52
|
it 'uses the current time if no timestamp is given' do
|
53
53
|
client.track_content(Factory.content.merge("created_at" => nil))
|
54
54
|
|
55
|
-
expected_body = JSON.generate(Factory.content.merge("created_at" => Time.now))
|
55
|
+
expected_body = JSON.generate(Factory.content.merge("created_at" => Time.now.iso8601))
|
56
56
|
expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/content").with(body: expected_body)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'makes the correct request converting created_at time to iso8601 string' do
|
60
60
|
client.track_content Factory.content
|
61
61
|
|
62
|
-
expected_body = JSON.generate(Factory.content.merge("created_at" => Factory.content["created_at"]))
|
62
|
+
expected_body = JSON.generate(Factory.content.merge("created_at" => Factory.content["created_at"].iso8601))
|
63
63
|
expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/content").with(body: expected_body)
|
64
64
|
end
|
65
65
|
|
@@ -90,7 +90,7 @@ module Koko
|
|
90
90
|
it 'makes the correct request converting created_at time to float' do
|
91
91
|
client.track_flag Factory.flag
|
92
92
|
|
93
|
-
expected_body = JSON.generate(Factory.flag.merge("created_at" => Factory.flag["created_at"]))
|
93
|
+
expected_body = JSON.generate(Factory.flag.merge("created_at" => Factory.flag["created_at"].iso8601))
|
94
94
|
expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/flag").with(body: expected_body)
|
95
95
|
end
|
96
96
|
end
|
@@ -115,7 +115,7 @@ module Koko
|
|
115
115
|
it 'makes the correct request converting created_at time to float' do
|
116
116
|
client.track_moderation Factory.moderation
|
117
117
|
|
118
|
-
expected_body = JSON.generate(Factory.moderation.merge("created_at" => Factory.moderation["created_at"]))
|
118
|
+
expected_body = JSON.generate(Factory.moderation.merge("created_at" => Factory.moderation["created_at"].iso8601))
|
119
119
|
expect(WebMock).to have_requested(:post, "https://#{Defaults::Request.host}/track/moderation").with(body: expected_body)
|
120
120
|
end
|
121
121
|
end
|