Sha256: a8076eef5c2a97d81cf89b09fc61587a38f7b6f5cbfa7cf2550fa853ef7e38b0

Contents?: true

Size: 937 Bytes

Versions: 2

Compression:

Stored size: 937 Bytes

Contents

require 'spec_helper'

describe "Intercom::ExportContent" do
  let(:client) { Intercom::Client.new(token: 'token') }
  let(:job) {
    {
      job_identifier: "k0e27ohsyvh8ef3m",
      status: "no_data",
      download_url: "",
      download_expires_at: 0
    }
  }

  it "creates an export job" do
    client.expects(:post).with("/export/content/data", {"created_at_after" => 1667566801, "created_at_before" => 1668085202}).returns(job)
    client.export_content.create({"created_at_after" => 1667566801, "created_at_before" => 1668085202})
  end

  it "can view an export job" do
    client.expects(:get).with("/export/content/data/#{job[:job_identifier]}", {}).returns(job)
    client.export_content.find(id: job[:job_identifier])
  end

  it "Cancels a export job redirect" do
    client.expects(:post).with("/export/cancel/#{job[:job_identifier]}", {}).returns(job)
    client.export_content.cancel(job[:job_identifier])
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
intercom-4.2.1 spec/unit/intercom/export_content_spec.rb
intercom-4.2.0 spec/unit/intercom/export_content_spec.rb