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 +4 -4
- data/CHANGELOG.md +2 -1
- data/USAGE.md +8 -1
- data/lib/delighted.rb +1 -0
- data/lib/delighted/resources/unsubscribe.rb +7 -0
- data/lib/delighted/version.rb +1 -1
- data/test/delighted_test.rb +18 -0
- metadata +4 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3ad87422f0a3c2888d8aec218e1eef1786f930ac
         | 
| 4 | 
            +
              data.tar.gz: 9b6bd73d335809573992a4c86fafb41879f490e4
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 0ec34d554da5d9c06c9338cc4ab66c8f275c2c5ee2603fa99a853aaf7e89bf2c950bfb54d598ff0f3ab7fbbcbd4e769adb7dbd2e018f5ae20736a68e9f30bfb2
         | 
| 7 | 
            +
              data.tar.gz: 4709b12b530161bdd4b3b2d4ae2c89c72846f4cc6b5c47ada2bc42b3b49f4049f312e0572c0a88531e077ec790dad11d00cb1b7e0f4c80221367809d34ac816d
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        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(: | 
| 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'
         | 
    
        data/lib/delighted/version.rb
    CHANGED
    
    
    
        data/test/delighted_test.rb
    CHANGED
    
    | @@ -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. | 
| 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 | 
| 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: 
         |