summaryrefslogtreecommitdiff
path: root/spec/unit/audit/audit_reporter_spec.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2015-12-02 12:19:33 +0000
committerThom May <thom@chef.io>2016-01-11 15:40:42 +0000
commitd99e306a41b1402209d320cb7119b12a3bbb962f (patch)
treef65940702826deb991e6198967d3e9e96cb2857a /spec/unit/audit/audit_reporter_spec.rb
parent1b71aeb423b009f6d1a44215c89e9976957b47e9 (diff)
downloadchef-d99e306a41b1402209d320cb7119b12a3bbb962f.tar.gz
Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_rest
In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
Diffstat (limited to 'spec/unit/audit/audit_reporter_spec.rb')
-rw-r--r--spec/unit/audit/audit_reporter_spec.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/spec/unit/audit/audit_reporter_spec.rb b/spec/unit/audit/audit_reporter_spec.rb
index 46c2a96b4c..1a8cee1cd5 100644
--- a/spec/unit/audit/audit_reporter_spec.rb
+++ b/spec/unit/audit/audit_reporter_spec.rb
@@ -57,7 +57,6 @@ describe Chef::Audit::AuditReporter do
before do
allow(reporter).to receive(:auditing_enabled?).and_return(true)
allow(reporter).to receive(:run_status).and_return(run_status)
- allow(rest).to receive(:create_url).and_return(true)
allow(rest).to receive(:post).and_return(true)
allow(reporter).to receive(:audit_data).and_return(audit_data)
allow(reporter).to receive(:run_status).and_return(run_status)
@@ -75,16 +74,12 @@ describe Chef::Audit::AuditReporter do
end
it "posts audit data to server endpoint" do
- endpoint = "api.opscode.us/orgname/controls"
headers = {
'X-Ops-Audit-Report-Protocol-Version' => Chef::Audit::AuditReporter::PROTOCOL_VERSION
}
- expect(rest).to receive(:create_url).
- with("controls").
- and_return(endpoint)
expect(rest).to receive(:post).
- with(endpoint, run_data, headers)
+ with("controls", run_data, headers)
reporter.run_completed(node)
end
@@ -255,7 +250,6 @@ EOM
context "when no prior exception is stored" do
it "reports no error" do
- expect(rest).to receive(:create_url)
expect(rest).to receive(:post)
reporter.run_failed(run_error)
expect(run_data).to_not have_key(:error)
@@ -268,7 +262,6 @@ EOM
end
it "reports the prior error" do
- expect(rest).to receive(:create_url)
expect(rest).to receive(:post)
reporter.run_failed(run_error)
expect(run_data).to have_key(:error)