Sha256: 7f92f25e274e997c222ab4168453bdf31f5c3f8f1de4773cc3af3b1e8a254406

Contents?: true

Size: 974 Bytes

Versions: 23

Compression:

Stored size: 974 Bytes

Contents

require 'spec_helper'

describe SendGrid::TrackingSettingsDto do
  let(:sendgrid_client) { SendGrid::API.new(api_key: 'fake_key').client }
  let(:tracking_settings) { SendGrid::TrackingSettingsDto }
  let(:setting_name) { 'open_tracking' }
  let(:setting_params) { {enabled: rand(1..100).even?} }

  it { should respond_to :open_tracking }
  it { should respond_to :click_tracking }
  it { should respond_to :google_analytics }
  it { should respond_to :subscription_tracking }

  describe '.fetch' do
    it 'calls get on sendgrid_client' do
      args = { sendgrid_client: sendgrid_client, name: setting_name, query_params: {} }
      expect(tracking_settings.fetch(args)).to be_a SendGrid::Response
    end
  end

  describe '.update' do
    it 'calls patch on sendgrid_client' do
      args = { sendgrid_client: sendgrid_client, name: setting_name, request_body: setting_params }
      expect(tracking_settings.update(args)).to be_a SendGrid::Response
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
sendgrid-ruby-6.3.4 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.3.3 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.3.2 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.3.1 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.2.1 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.2.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.1.4 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.1.3 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.1.2 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.1.1 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.1.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.0.4 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.0.3 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.0.2 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.0.1 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-6.0.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-5.3.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-5.2.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-5.1.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb
sendgrid-ruby-5.0.0 spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb