calx_client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/calx_client.rb +2 -3
- data/lib/calx_client/version.rb +3 -0
- data/spec/calx_client_spec.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e8025bca236be9651ac603cd97fd71147e4420c
|
4
|
+
data.tar.gz: e0a1fe582909351a30f740df7bd7d36afc0ea27e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea51b0554fd61947ddb9f9f97a0223f3f59aa10d1171a4ebf266ace9b8b8246329731d0454bad74677a62ca1d6c46a09c301729992d7c9190136334268af6f12
|
7
|
+
data.tar.gz: 83547c62af0d3a4cf3b9c31a80d3ae8951c0e0d2ef4d8a19e5bf943ce19e47ade63746fe1a5f873255edfb1a01db2f4d5a5dc313c2cdc7a69904bbb30c9d5691
|
data/Gemfile.lock
CHANGED
data/lib/calx_client.rb
CHANGED
@@ -38,7 +38,7 @@ module CalX
|
|
38
38
|
private
|
39
39
|
|
40
40
|
def get(request_uri, params = {})
|
41
|
-
request_uri += "?#{encode_params(params)}" unless params.
|
41
|
+
request_uri += "?#{encode_params(params)}" unless params.empty?
|
42
42
|
uri = URI(@host + request_uri)
|
43
43
|
request = Net::HTTP::Get.new(uri.request_uri)
|
44
44
|
request(uri, request)
|
@@ -96,8 +96,7 @@ module CalX
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def error_response_message(response, uri)
|
99
|
-
|
100
|
-
message + " | Response body: #{JSON.parse(response.body)}" unless response.body.nil?
|
99
|
+
"#{response.code} response from #{uri.host}"
|
101
100
|
end
|
102
101
|
|
103
102
|
def http(uri)
|
data/spec/calx_client_spec.rb
CHANGED
@@ -40,6 +40,17 @@ describe CalX::Client do
|
|
40
40
|
it 'returns the events' do
|
41
41
|
expect(subject.events(user_id, date: date)).to eq(response_body)
|
42
42
|
end
|
43
|
+
|
44
|
+
context 'no date parameter' do
|
45
|
+
before do
|
46
|
+
stub_request(:get, "#{host}/users/#{user_id}/events").
|
47
|
+
to_return(body: response_body.to_json, status: 200, headers: headers)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'returns the events' do
|
51
|
+
expect(subject.events(user_id)).to eq(response_body)
|
52
|
+
end
|
53
|
+
end
|
43
54
|
end
|
44
55
|
|
45
56
|
describe '#event' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calx_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mert Guldur
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- Rakefile
|
125
125
|
- calx_client.gemspec
|
126
126
|
- lib/calx_client.rb
|
127
|
+
- lib/calx_client/version.rb
|
127
128
|
- spec/calx_client_spec.rb
|
128
129
|
- spec/spec_helper.rb
|
129
130
|
homepage:
|