Sha256: 1c08d74ff20f1fe3199e29b09f141bed6082fe9b45670ba5ef48e0e4389e8cf9

Contents?: true

Size: 803 Bytes

Versions: 6

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'email status' do
  let(:email) { 'john@example.com' }
  let(:status) { :unsubscribed }

  subject do
    api.email_status(email: email, status: status)
  end

  context 'existing email', vcr: true do
    it 'responds with created' do
      expect(subject.status).to be 201
    end

    it 'responds with success message' do
      expect(JSON.parse(subject.body)).to eq(
        'message' => 'success'
      )
    end
  end

  context 'unknown email', vcr: true do
    let(:email) { 'notthere@example.com' }

    it 'responds with bad request' do
      expect(subject.status).to be 201
    end

    it 'responds with success message' do
      expect(JSON.parse(subject.body)).to eq(
        'message' => 'success'
      )
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
braze_ruby-0.4.2 spec/integrations/email_status_spec.rb
braze_ruby-0.4.1 spec/integrations/email_status_spec.rb
braze_ruby-0.4.0 spec/integrations/email_status_spec.rb
braze_ruby-0.3.3 spec/integrations/email_status_spec.rb
braze_ruby-0.3.2 spec/integrations/email_status_spec.rb
braze_ruby-0.3.1 spec/integrations/email_status_spec.rb