Module: SeismicAPI::WebmockStubs

Defined in:
lib/seismic_api/webmock_stubs.rb

Instance Method Summary collapse

Instance Method Details

#successful_publish_stub(teamsiteId: "32", contentId: "831") ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/seismic_api/webmock_stubs.rb', line 3

def successful_publish_stub(teamsiteId: "32", contentId: "831")
  stub_request(:post, "#{teamsites_url}/#{teamsiteId}/publish")
    .with(
      headers: common_post_headers,
      body: {
        content: [
          { id: contentId }
        ]
      }
  ).to_return(body: {
    "totalRequests" => "1",
    "totalErrors" => "0",
    "totalSucceeded" => "1",
    "totalWarnings" => "0",
    "errors" => [],
    "warnings" => []
  }.to_json)
end