Sha256: 97a318914652e58623eb498799c130c57526ded3ee49f1452965c10f1ba07697

Contents?: true

Size: 948 Bytes

Versions: 5

Compression:

Stored size: 948 Bytes

Contents

require 'helper'

class TestMadmimi < Test::Unit::TestCase
  context "A API call" do
    setup do
      @mimi = MadMimi.new('email@example.com', 'testapikey')
    end
    
    should "retrieve a hash of promotions" do
      stub_get('/promotions.xml', 'promotions.xml')
      response = @mimi.promotions
      flunk "I couldn't find any promotions." unless response.kind_of?(Hash) || !response.empty?
    end
    
    should "retrieve a hash of lists" do
      stub_get('/audience_lists/lists.xml', 'lists.xml')
      response = @mimi.lists
      flunk "Doesn't return any lists." unless response.kind_of?(Hash) || !response.empty?
    end
    
    should "retrieve a hash of users found with the search term nicholas" do
      stub_get('/audience_members/search.xml?query=nicholas', 'search.xml')
      response = @mimi.audience_search('nicholas')
      flunk "No users found." unless response.kind_of?(Hash) || !response.empty?
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
madmimi-james2m-1.0.13 test/test_madmimi.rb
madmimi-bernardo-1.0.14 test/test_madmimi.rb
madmimi-1.0.13 test/test_madmimi.rb
madmimi-1.0.12 test/test_madmimi.rb
madmimi-1.0.11 test/test_madmimi.rb