Sha256: 60102259708cfb21f68b6f1b3e0620bb1b8a9825a9a13c4f01a54ff601b8be0a
Contents?: true
Size: 1.18 KB
Versions: 1
Compression:
Stored size: 1.18 KB
Contents
require 'helper' class TestMadmimi < Test::Unit::TestCase context "An API call" do setup do @mimi = MadMimi.new('email@example.com', 'testapikey') end should "retrieve a hash of promotions" do stub_get('/promotions.xml', { :filename => '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', { :filename => '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', { :filename => 'search.xml'}) response = @mimi.audience_search('nicholas') flunk "No users found." unless response.kind_of?(Hash) || !response.empty? end should "get a transactional mailing status" do stub_get('/mailers/status/1234', { :https => true, :body => "sent" }) response = @mimi.status(1234) assert_equal "sent", response end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
madmimi-1.0.14 | test/test_madmimi.rb |