Sha256: 9b48512d88e60394fd840728a1ac3157ee21ba526490bc5fd0eee74a969e2849

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

# rake test TEST=test/ad_image_test.rb
class AdImageTest < BaseTest
  def test_list
    vcr do
      account = FacebookAds::AdAccount.find_by(name: 'ReFuel4')
      ad_images = account.ad_images(hashes: %w(a9e27630331b8ca2ebac1bb8619c98eb 037b8f4f2383f45f35b110cf72c46f0b))
      assert_equal 2, ad_images.length
    end
  end

  def test_create
    vcr do
      account = FacebookAds::AdAccount.find_by(name: 'ReFuel4')
      ad_images = account.create_ad_images(['https://img0.etsystatic.com/108/1/13006112/il_570xN.1047856494_l2gp.jpg'])
      ad_image = ad_images.first
      assert_equal '1132789356764349:287ecd37223004c301f5df4e4d02bbe2', ad_image.id
      assert_equal '287ecd37223004c301f5df4e4d02bbe2', ad_image.hash
      assert_equal '1132789356764349', ad_image.account_id
      assert_equal '13006112.jpg', ad_image.name
      assert ad_image.permalink_url.include?('https://www.facebook.com/ads/image/?d=')
      assert_equal 570, ad_image.original_width
      assert_equal 707, ad_image.original_height
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facebook_ads-0.1.11 test/ad_image_test.rb
facebook_ads-0.1.10 test/ad_image_test.rb
facebook_ads-0.1.9 test/ad_image_test.rb
facebook_ads-0.1.8 test/ad_image_test.rb
facebook_ads-0.1.7 test/ad_image_test.rb