Sha256: 5c45211efbd67474f9434fa08939575be4ce6328ac1446a381fec2e8fa8aa73c

Contents?: true

Size: 1.54 KB

Versions: 7

Compression:

Stored size: 1.54 KB

Contents

require_relative '../examples'

RSpec.describe 'CampaignManagement service' do
  include_context 'use api'

  describe 'UET methods' do
    let(:get_uet_tags_by_ids) do
      api.campaign_management.get_uet_tags_by_ids(
        tag_ids: [
          { long: Examples.uet_tag_id }
        ]
      )
    end

    describe '#get_uet_tags_by_ids' do
      it 'returns a list of UET tags' do
        expect(get_uet_tags_by_ids).to contain_exactly(
          {
            description:  a_kind_of(String),
            id: a_kind_of(String),
            name: a_string_starting_with('Acceptance Test UET Tag'),
            tracking_no_script: a_string_starting_with("<img src=\"//bat.bing.com/action/"),
            tracking_script: a_string_starting_with('<script>(function(w,d,t,r,u)'),
            tracking_status: 'Unverified',
            customer_share: nil
          }
        )
      end
    end

    describe '#update_uet_tags' do
      subject do
        api.campaign_management.update_uet_tags({
          uet_tags: [
            {
              uet_tag: {
                name: "Acceptance Test UET Tag - #{random}",
                id: Examples.uet_tag_id,
                description: "UET Tag Description - #{random}",
              }
            }
          ]
        })
      end

      it 'updates the UET tag fields' do
        is_expected.to eq(partial_errors: '')

        expect(get_uet_tags_by_ids.first).to include(
          name: "Acceptance Test UET Tag - #{random}",
          description: "UET Tag Description - #{random}"
        )
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bing_ads_ruby_sdk-1.3.4 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.3.3 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.3.2 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.3.1 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.3.0 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.2.0 spec/examples/3_with_uet_tag/uet_tags_spec.rb
bing_ads_ruby_sdk-1.1.1 spec/examples/3_with_uet_tag/uet_tags_spec.rb