test/eroi/client_test.rb in eroi-0.1.3 vs test/eroi/client_test.rb in eroi-0.1.4
- old
+ new
@@ -41,10 +41,26 @@
assert_equal true, response.success?
assert_equal 1, response.number_of_records
end
end
+ context "when adding contacts" do
+ should "respond with a success" do
+ response = @client.add_contacts(
+ [{ :email => 'longbob@longbob.com',
+ :firstname => 'Longbob',
+ :lastname => 'Longson',
+ :mailing_lists => 'TestList' },
+ { :email => 'shortbob@shortbob.com',
+ :firstname => 'Shortbob',
+ :lastname => 'Shortson',
+ :mainling_lists => 'TestList' }])
+
+ assert_equal true, response.success?
+ end
+ end
+
context "when changing a contact's email" do
should "respond with a success" do
response = @client.change_contact_email(
'longbob@longbob.com', 'longbob@boblong.com')
@@ -58,9 +74,26 @@
response = @client.update_contact(
:email => 'longbob@longbob.com',
:firstname => 'Longbob',
:lastname => 'Longson',
:mailing_lists => 'TestList')
+
+ assert_equal true, response.success?
+ assert_equal 1, response.number_of_records
+ end
+ end
+
+ context "when updating contacts" do
+ should "respond with a success" do
+ response = @client.update_contacts(
+ [{ :email => 'longbob@longbob.com',
+ :firstname => 'Shortbob',
+ :lastname => 'Shortson',
+ :mailing_lists => 'TestList' },
+ { :email => 'shortbob@shortbob.com',
+ :firstname => 'Longbob',
+ :lastname => 'Longson',
+ :mainling_lists => 'TestList' }])
assert_equal true, response.success?
assert_equal 1, response.number_of_records
end
end