delighted 1.3.0.rc1 → 1.3.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d0398185f79509fb4bd2b35e4e25ba8b4b9653d
4
- data.tar.gz: 25ecde8c4fc548fc4571a8c25244c0930c833e14
3
+ metadata.gz: 3ad87422f0a3c2888d8aec218e1eef1786f930ac
4
+ data.tar.gz: 9b6bd73d335809573992a4c86fafb41879f490e4
5
5
  SHA512:
6
- metadata.gz: 5e8e06cd8ce9df39d61a0257bcd7ba4fa6db2b340917b883921b30bee40a051fd757cdd94fbb70166d27a8afa93daec5da570c2995aa7eaadfe1dfefffbf6681
7
- data.tar.gz: 913d32f3d9e4fa207c2e40fd314bb85196060302e4c1a457c6b185d99a79a383382e3d3e8147480d04a65ee52d140491601e2dc1aea7a53427151da16c0746cb
6
+ metadata.gz: 0ec34d554da5d9c06c9338cc4ab66c8f275c2c5ee2603fa99a853aaf7e89bf2c950bfb54d598ff0f3ab7fbbcbd4e769adb7dbd2e018f5ae20736a68e9f30bfb2
7
+ data.tar.gz: 4709b12b530161bdd4b3b2d4ae2c89c72846f4cc6b5c47ada2bc42b3b49f4049f312e0572c0a88531e077ec790dad11d00cb1b7e0f4c80221367809d34ac816d
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
- ## 1.3.0.rc1 (2014-03-14)
1
+ ## 1.3.0.rc2 (2014-06-03)
2
2
 
3
3
  Features:
4
4
 
5
5
  - Add support expanding person on SurveyResponses
6
+ - Add support for new Unsubscribes endpoint
6
7
 
7
8
  ## 1.2.0 (2014-02-28)
8
9
 
data/USAGE.md CHANGED
@@ -40,11 +40,18 @@ updated_person1 = Delighted::Person.create(:email => "foo+testing1@delightedapp.
40
40
  :name => "James Scott", :send => false)
41
41
  ```
42
42
 
43
+ ### Unsubscribing people
44
+
45
+ ```ruby
46
+ # Unsubscribe an existing person
47
+ Delighted::Unsubscribe.create(:person_email => "foo+testing1@delightedapp.com")
48
+ ```
49
+
43
50
  ### Deleting pending survey requests
44
51
 
45
52
  ```ruby
46
53
  # Delete all pending (scheduled but unsent) survey requests for a person, by email.
47
- Delighted::SurveyRequest.delete_pending(:email => "foo+testing1@delightedapp.com")
54
+ Delighted::SurveyRequest.delete_pending(:person_email => "foo+testing1@delightedapp.com")
48
55
  ```
49
56
 
50
57
  ### Adding survey responses
data/lib/delighted.rb CHANGED
@@ -19,6 +19,7 @@ require 'delighted/resources/metrics'
19
19
  require 'delighted/resources/person'
20
20
  require 'delighted/resources/survey_request'
21
21
  require 'delighted/resources/survey_response'
22
+ require 'delighted/resources/unsubscribe'
22
23
 
23
24
  require 'delighted/errors'
24
25
  require 'delighted/http_response'
@@ -0,0 +1,7 @@
1
+ module Delighted
2
+ class Unsubscribe < Resource
3
+ self.path = '/unsubscribes'
4
+
5
+ include Operations::Create
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Delighted
2
- VERSION = "1.3.0.rc1"
2
+ VERSION = "1.3.0.rc2"
3
3
  end
@@ -37,6 +37,24 @@ class Delighted::PeopleTest < Delighted::TestCase
37
37
  assert_equal '123', person.id
38
38
  end
39
39
 
40
+ def test_unsubscribing_a_person
41
+ person_email = 'person@example.com'
42
+ uri = URI.parse('https://api.delightedapp.com/v1/unsubscribes')
43
+ headers = {
44
+ 'Authorization' => "Basic #{["123abc:"].pack('m0')}",
45
+ 'Accept' => 'application/json',
46
+ 'Content-Type' => 'application/json',
47
+ 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}"
48
+ }
49
+ data = Delighted::JSON.dump(:person_email => person_email)
50
+ response = Delighted::HTTPResponse.new(200, {}, Delighted::JSON.dump({ :ok => true }))
51
+ mock_http_adapter.expects(:request).
52
+ with(:post, uri, headers, data).once.
53
+ returns(response)
54
+
55
+ survey_response = Delighted::Unsubscribe.create(:person_email => person_email)
56
+ end
57
+
40
58
  def test_deleting_pending_survey_requests_for_a_person
41
59
  uri = URI.parse("https://api.delightedapp.com/v1/people/foo%40bar.com/survey_requests/pending")
42
60
  headers = { 'Authorization' => "Basic #{["123abc:"].pack('m0')}", "Accept" => "application/json", 'Content-Type' => 'application/json', 'User-Agent' => "Delighted RubyGem #{Delighted::VERSION}" }
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.0.rc1
4
+ version: 1.3.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Dodwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-14 00:00:00.000000000 Z
11
+ date: 2014-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -97,6 +97,7 @@ files:
97
97
  - lib/delighted/resources/person.rb
98
98
  - lib/delighted/resources/survey_request.rb
99
99
  - lib/delighted/resources/survey_response.rb
100
+ - lib/delighted/resources/unsubscribe.rb
100
101
  - lib/delighted/utils.rb
101
102
  - lib/delighted/version.rb
102
103
  - test/delighted_test.rb
@@ -129,3 +130,4 @@ summary: Delighted is the easiest and most beautiful way to measure customer hap
129
130
  test_files:
130
131
  - test/delighted_test.rb
131
132
  - test/test_helper.rb
133
+ has_rdoc: