test/createsend_test.rb in createsend-1.0.2 vs test/createsend_test.rb in createsend-1.0.3

- old
+ new

@@ -7,10 +7,18 @@ @base_uri = 'https://api.createsend.com/api/v3' CreateSend.api_key @api_key @cs = CreateSend::CreateSend.new end + should "include the CreateSend module VERSION constant as part of the user agent when making a call" do + # This test is done to ensure that the version from HTTParty isn't included instead + assert CreateSend::CreateSend.headers["User-Agent"] == "createsend-ruby-#{CreateSend::VERSION}" + stub_get(@api_key, "clients.json", "clients.json") + clients = @cs.clients + clients.size.should == 2 + end + should "get api key" do uri = URI.parse(@base_uri) site_url = "http://iamadesigner.createsend.com/" username = "myusername" password = "mypassword" @@ -52,10 +60,10 @@ setup do @api_key = '123123123123123123123' @base_uri = 'https://api.createsend.com/api/v3' CreateSend.api_key @api_key @cs = CreateSend::CreateSend.new - @template = CreateSend::Template.new(:template_id => '98y2e98y289dh89h938389') + @template = CreateSend::Template.new('98y2e98y289dh89h938389') end { ["400", "Bad Request"] => CreateSend::BadRequest, ["401", "Unauthorized"] => CreateSend::Unauthorized, ["404", "Not Found"] => CreateSend::NotFound,