Skip to content

Commit

Permalink
upgraded nice_hash version
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRuiz committed Aug 30, 2019
1 parent c9eb347 commit 020726c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nice_http.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'nice_http'
s.version = '1.7.16'
s.version = '1.7.17'
s.summary = "NiceHttp -- simplest library for accessing and testing HTTP and REST resources. Get http logs and statistics automatically. Use hashes on your requests. Access JSON even easier."
s.description = "NiceHttp -- simplest library for accessing and testing HTTP and REST resources. Get http logs and statistics automatically. Use hashes on your requests. Access JSON even easier."
s.authors = ["Mario Ruiz"]
Expand All @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ["LICENSE","README.md"]
s.homepage = 'https://github.com/MarioRuiz/nice_http'
s.license = 'MIT'
s.add_runtime_dependency 'nice_hash', '~> 1.13', '>= 1.13.0'
s.add_runtime_dependency 'nice_hash', '~> 1.14', '>= 1.14.0'
s.add_development_dependency 'rspec', '~> 3.8', '>= 3.8.0'
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ["lib"]
Expand Down
14 changes: 14 additions & 0 deletions spec/nice_http/put_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@
expect(resp.data.json(:name)).to eq "peter"
end

it "changes :data when supplied nested keys on :values_for" do
request = {
path: "/api/users",
data: {name: "morpheus", job: {position:"leader"}},
}

request.values_for = {'job.position': "worker"}
resp = @http.put(request)
pp resp.data
expect(resp.code).to eq 200
expect(resp.data.json(:position)).to eq "worker"
end


it 'doesn\'t redirect when auto_redirect is false and http code is 30x' do
server = "http://examplesinatra--tcblues.repl.co/"
http = NiceHttp.new(server)
Expand Down

0 comments on commit 020726c

Please sign in to comment.