diff options
author | John Keiser <jkeiser@opscode.com> | 2013-10-08 20:40:08 -0700 |
---|---|---|
committer | John Keiser <jkeiser@opscode.com> | 2013-10-09 09:21:02 -0700 |
commit | 836705dee684032baa85920c808a3eca5f5a8a87 (patch) | |
tree | eb6373c1ee4e352ba58c8beef0ddfd194b749cf7 /spec/integration/knife | |
parent | a44352871130b3adea32c93bdaca696b518a335a (diff) | |
download | chef-836705dee684032baa85920c808a3eca5f5a8a87.tar.gz |
CHEF-4515: upload sometimes inflates JSON. Fix by using true raw version of Chef::REST
Diffstat (limited to 'spec/integration/knife')
-rw-r--r-- | spec/integration/knife/raw_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/redirection_spec.rb | 4 | ||||
-rw-r--r-- | spec/integration/knife/upload_spec.rb | 9 |
3 files changed, 14 insertions, 3 deletions
diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb index 7ebe5476d9..b7412e4e8a 100644 --- a/spec/integration/knife/raw_spec.rb +++ b/spec/integration/knife/raw_spec.rb @@ -214,13 +214,13 @@ EOM end it 'knife raw /blah returns the raw text' do - knife('raw /blah').should_succeed <<EOM + knife('raw /blah').should_succeed(<<EOM, :stderr => "WARN: Expected JSON response, but got content-type 'text'\n") { "x": "y", "a": "b" } EOM end it 'knife raw --no-pretty /blah returns the raw text' do - knife('raw --no-pretty /blah').should_succeed <<EOM + knife('raw --no-pretty /blah').should_succeed(<<EOM, :stderr => "WARN: Expected JSON response, but got content-type 'text'\n") { "x": "y", "a": "b" } EOM end diff --git a/spec/integration/knife/redirection_spec.rb b/spec/integration/knife/redirection_spec.rb index 5af9fd36e1..48944b1140 100644 --- a/spec/integration/knife/redirection_spec.rb +++ b/spec/integration/knife/redirection_spec.rb @@ -50,7 +50,9 @@ describe 'redirection' do end it 'knife list /roles returns the role' do - knife('list /roles').should_succeed "/roles/x.json\n" + pending 'merge of api-code-path branch' do + knife('list /roles').should_succeed "/roles/x.json\n" + end end end end diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb index 770efb2d46..46b804205f 100644 --- a/spec/integration/knife/upload_spec.rb +++ b/spec/integration/knife/upload_spec.rb @@ -1064,4 +1064,13 @@ EOM end end # with versioned cookbooks + when_the_chef_server 'has a user' do + user 'x', {} + when_the_repository 'has the same user with json_class in it' do + file 'users/x.json', { 'admin' => true, 'json_class' => 'Chef::WebUIUser' } + it 'knife upload /users/x.json succeeds' do + knife('upload /users/x.json').should_succeed "Updated /users/x.json\n" + end + end + end end |