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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b63479923ef59460370bd9e4e3aecccf0a01103
4
- data.tar.gz: 349ee83773fd8b207229c94555c151e952c2a166
3
+ metadata.gz: 3e8025bca236be9651ac603cd97fd71147e4420c
4
+ data.tar.gz: e0a1fe582909351a30f740df7bd7d36afc0ea27e
5
5
  SHA512:
6
- metadata.gz: 9a3ff2304d4cc0c04a45eaccc4c90eb58093f6483a49937f05cfa1cc7f30725cf784d71df9e05f07ea95366aa7624947c3d8a2866af5f47c02220a1134d0aa58
7
- data.tar.gz: a5407fa15f2b713e092ab8a19aa7103118b3b34821cf52d820e27c851af57e90a35bbc9eae72e0a7f539237d6adbceb232962b73e449cfde974d0fe5335549cb
6
+ metadata.gz: ea51b0554fd61947ddb9f9f97a0223f3f59aa10d1171a4ebf266ace9b8b8246329731d0454bad74677a62ca1d6c46a09c301729992d7c9190136334268af6f12
7
+ data.tar.gz: 83547c62af0d3a4cf3b9c31a80d3ae8951c0e0d2ef4d8a19e5bf943ce19e47ade63746fe1a5f873255edfb1a01db2f4d5a5dc313c2cdc7a69904bbb30c9d5691
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- calx_client (0.0.1)
4
+ calx_client (0.1.1)
5
5
  api-auth
6
6
 
7
7
  GEM
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.nil?
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
- message = "#{response.code} response from #{uri.host}"
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)
@@ -0,0 +1,3 @@
1
+ module CalX
2
+ VERSION = '0.1.1'.freeze
3
+ end
@@ -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.0
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: