delighted 1.3.0 → 1.3.1
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/delighted/client.rb +1 -1
- data/lib/delighted/version.rb +1 -1
- data/test/delighted_test.rb +7 -7
- data/test/test_helper.rb +1 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37805cf1e7b0836ab7a522aa3e886cc2c82cb0f4
|
4
|
+
data.tar.gz: bb1dc6a443bc57aa8784f91dfc75d95d07326b7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5aecf2f1cbb700dc8acb92232e754384809681817450e73a69a6ea2eac219957d112e350e1e0ac6305d0f04ad79fccce921688d1e94d75f4eeb74d03ad48a2
|
7
|
+
data.tar.gz: 265dfdeed0e7d351bf21f44dde3d6416ca725b4917eb43ed1334a10466b7af808c0ab5522318c6eaf755422d3e8d42a7e2c375e39f65d504c7910fd0ad4fd909
|
data/CHANGELOG.md
CHANGED
data/lib/delighted/client.rb
CHANGED
@@ -60,7 +60,7 @@ module Delighted
|
|
60
60
|
|
61
61
|
def default_headers
|
62
62
|
@default_headers ||= {
|
63
|
-
'Authorization' => "Basic #{["#{@api_key}:"].pack('
|
63
|
+
'Authorization' => "Basic #{["#{@api_key}:"].pack('m').chomp}",
|
64
64
|
'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}"
|
65
65
|
}.freeze
|
66
66
|
end
|
data/lib/delighted/version.rb
CHANGED
data/test/delighted_test.rb
CHANGED
@@ -10,7 +10,7 @@ end
|
|
10
10
|
class Delighted::MetricsTest < Delighted::TestCase
|
11
11
|
def test_retrieving_metrics
|
12
12
|
uri = URI.parse("https://api.delightedapp.com/v1/metrics")
|
13
|
-
headers = { 'Authorization' =>
|
13
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
14
14
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump({ :nps => 10 }))
|
15
15
|
mock_http_adapter.expects(:request).with(:get, uri, headers).once.returns(response)
|
16
16
|
|
@@ -25,7 +25,7 @@ end
|
|
25
25
|
class Delighted::PeopleTest < Delighted::TestCase
|
26
26
|
def test_creating_or_updating_a_person
|
27
27
|
uri = URI.parse("https://api.delightedapp.com/v1/people")
|
28
|
-
headers = { 'Authorization' =>
|
28
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'Content-Type' => 'application/json', 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
29
29
|
data = Delighted::JSON.dump({ :email => 'foo@bar.com' })
|
30
30
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump({ :id => '123', :email => 'foo@bar.com' }))
|
31
31
|
mock_http_adapter.expects(:request).with(:post, uri, headers, data).once.returns(response)
|
@@ -41,7 +41,7 @@ class Delighted::PeopleTest < Delighted::TestCase
|
|
41
41
|
person_email = 'person@example.com'
|
42
42
|
uri = URI.parse('https://api.delightedapp.com/v1/unsubscribes')
|
43
43
|
headers = {
|
44
|
-
'Authorization' =>
|
44
|
+
'Authorization' => @auth_header,
|
45
45
|
'Accept' => 'application/json',
|
46
46
|
'Content-Type' => 'application/json',
|
47
47
|
'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}"
|
@@ -57,7 +57,7 @@ class Delighted::PeopleTest < Delighted::TestCase
|
|
57
57
|
|
58
58
|
def test_deleting_pending_survey_requests_for_a_person
|
59
59
|
uri = URI.parse("https://api.delightedapp.com/v1/people/foo%40bar.com/survey_requests/pending")
|
60
|
-
headers = { 'Authorization' =>
|
60
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'Content-Type' => 'application/json', 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
61
61
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump({ :ok => true }))
|
62
62
|
mock_http_adapter.expects(:request).with(:delete, uri, headers, nil).once.returns(response)
|
63
63
|
|
@@ -70,7 +70,7 @@ end
|
|
70
70
|
class Delighted::SurveyResponseTest < Delighted::TestCase
|
71
71
|
def test_creating_a_survey_response
|
72
72
|
uri = URI.parse("https://api.delightedapp.com/v1/survey_responses")
|
73
|
-
headers = { 'Authorization' =>
|
73
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'Content-Type' => 'application/json', 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
74
74
|
data = Delighted::JSON.dump({ :person => '123', :score => 10 })
|
75
75
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump({ :id => '456', :person => '123', :score => 10 }))
|
76
76
|
mock_http_adapter.expects(:request).with(:post, uri, headers, data).once.returns(response)
|
@@ -85,7 +85,7 @@ class Delighted::SurveyResponseTest < Delighted::TestCase
|
|
85
85
|
|
86
86
|
def test_listing_all_survey_responses
|
87
87
|
uri = URI.parse("https://api.delightedapp.com/v1/survey_responses?order=desc")
|
88
|
-
headers = { 'Authorization' =>
|
88
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
89
89
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump([{ :id => '123', :comment => 'One' }, { :id => '456', :comment => 'Two' }]))
|
90
90
|
mock_http_adapter.expects(:request).with(:get, uri, headers).once.returns(response)
|
91
91
|
|
@@ -103,7 +103,7 @@ class Delighted::SurveyResponseTest < Delighted::TestCase
|
|
103
103
|
|
104
104
|
def test_listing_all_survey_responses_expand_person
|
105
105
|
uri = URI.parse("https://api.delightedapp.com/v1/survey_responses?expand%5B%5D=person")
|
106
|
-
headers = { 'Authorization' =>
|
106
|
+
headers = { 'Authorization' => @auth_header, "Accept" => "application/json", 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
|
107
107
|
response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump([{ :id => '123', :comment => 'One', :person => { :id => '123', :email => 'foo@bar.com' } }, { :id => '456', :comment => 'Two', :person => { :id => '123', :email => 'foo@bar.com' } }]))
|
108
108
|
mock_http_adapter.expects(:request).with(:get, uri, headers).once.returns(response)
|
109
109
|
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delighted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.0.14
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Delighted is the easiest and most beautiful way to measure customer happiness.
|
@@ -130,4 +130,3 @@ summary: Delighted is the easiest and most beautiful way to measure customer hap
|
|
130
130
|
test_files:
|
131
131
|
- test/delighted_test.rb
|
132
132
|
- test/test_helper.rb
|
133
|
-
has_rdoc:
|