hal-client 3.1.1 → 3.1.2
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.
- data/.travis.yml +2 -1
- data/lib/hal_client/version.rb +1 -1
- data/lib/hal_client.rb +1 -1
- data/spec/hal_client_spec.rb +14 -0
- metadata +4 -4
    
        data/.travis.yml
    CHANGED
    
    
    
        data/lib/hal_client/version.rb
    CHANGED
    
    
    
        data/lib/hal_client.rb
    CHANGED
    
    | @@ -139,7 +139,7 @@ class HalClient | |
| 139 139 |  | 
| 140 140 | 
             
              # Returns an HTTP client.
         | 
| 141 141 | 
             
              def base_client
         | 
| 142 | 
            -
                @base_client ||= HTTP::Client.new
         | 
| 142 | 
            +
                @base_client ||= HTTP::Client.new(follow: true)
         | 
| 143 143 | 
             
              end
         | 
| 144 144 |  | 
| 145 145 | 
             
              attr_reader :default_entity_request_headers, :default_message_request_headers
         | 
    
        data/spec/hal_client_spec.rb
    CHANGED
    
    | @@ -224,6 +224,20 @@ describe HalClient do | |
| 224 224 | 
             
                end
         | 
| 225 225 | 
             
              end
         | 
| 226 226 |  | 
| 227 | 
            +
              context "get request redirection" do
         | 
| 228 | 
            +
                let!(:request) { stub_request(:get, "http://example.com/foo").
         | 
| 229 | 
            +
                  to_return(status: 301, headers: { 'Location' => "http://example.com/bar" } ) }
         | 
| 230 | 
            +
             | 
| 231 | 
            +
                let!(:second_req) { stub_request(:get, "http://example.com/bar").
         | 
| 232 | 
            +
                  to_return(body: "{}") }
         | 
| 233 | 
            +
             | 
| 234 | 
            +
                let!(:response) { client.get "http://example.com/foo" }
         | 
| 235 | 
            +
             | 
| 236 | 
            +
                it "follows redirects" do
         | 
| 237 | 
            +
                  expect(second_req).to have_been_made
         | 
| 238 | 
            +
                end
         | 
| 239 | 
            +
              end
         | 
| 240 | 
            +
             | 
| 227 241 |  | 
| 228 242 | 
             
              let(:post_data) { "ABC" }
         | 
| 229 243 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: hal-client
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3.1. | 
| 4 | 
            +
              version: 3.1.2
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2014- | 
| 12 | 
            +
            date: 2014-09-19 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: http
         | 
| @@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 190 190 | 
             
                  version: '0'
         | 
| 191 191 | 
             
                  segments:
         | 
| 192 192 | 
             
                  - 0
         | 
| 193 | 
            -
                  hash:  | 
| 193 | 
            +
                  hash: 916239915633512664
         | 
| 194 194 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 195 195 | 
             
              none: false
         | 
| 196 196 | 
             
              requirements:
         | 
| @@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 199 199 | 
             
                  version: '0'
         | 
| 200 200 | 
             
                  segments:
         | 
| 201 201 | 
             
                  - 0
         | 
| 202 | 
            -
                  hash:  | 
| 202 | 
            +
                  hash: 916239915633512664
         | 
| 203 203 | 
             
            requirements: []
         | 
| 204 204 | 
             
            rubyforge_project: 
         | 
| 205 205 | 
             
            rubygems_version: 1.8.23
         |