Sha256: 4394b400b73c17025a6381da77138143925ddf8e4026a6d48d252fac384b1e6f

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe Gibbon::MailChimpError do
  let(:message) { 'Foo' }
  let(:params) do
    {
      title: 'error_title',
      detail: 'error_detail',
      body: 'error_body',
      raw_body: 'error_raw_body',
      status_code: 'error_status_code'
    }
  end

  before do
    @gibbon = Gibbon::MailChimpError.new(message, params)
  end

  it "adds the error params to the error message" do
    expected_message = "Foo "                               \
                       "@title=\"error_title\", "           \
                       "@detail=\"error_detail\", "         \
                       "@body=\"error_body\", "             \
                       "@raw_body=\"error_raw_body\", "     \
                       "@status_code=\"error_status_code\""

    expect(@gibbon.message).to eq(expected_message)
  end

  it 'sets the title attribute' do
    expect(@gibbon.title).to eq(params[:title])
  end

  it 'sets the detail attribute' do
    expect(@gibbon.detail).to eq(params[:detail])
  end

  it 'sets the body attribute' do
    expect(@gibbon.body).to eq(params[:body])
  end

  it 'sets the raw_body attribute' do
    expect(@gibbon.raw_body).to eq(params[:raw_body])
  end

  it 'sets the status_code attribute' do
    expect(@gibbon.status_code).to eq(params[:status_code])
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gibbon-3.5.0 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.4.4 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.4.3 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.4.2 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.4.0 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.3.4 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.3.3 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.3.2 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.3.1 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.3.0 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.2.0 spec/gibbon/mailchimp_error_spec.rb
gibbon-3.1.1 spec/gibbon/mailchimp_error_spec.rb