spec/constantcontact/services/contact_service_spec.rb in constantcontact-1.3.2 vs spec/constantcontact/services/contact_service_spec.rb in constantcontact-2.0.0

- old
+ new

@@ -12,11 +12,11 @@ json = load_file('contacts_response.json') net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK') response = RestClient::Response.create(json, net_http_resp, {}) RestClient.stub(:get).and_return(response) - contacts = ConstantContact::Services::ContactService.get_contacts('token') + contacts = ConstantContact::Services::ContactService.get_contacts() contact = contacts.results[0] contacts.should be_kind_of(ConstantContact::Components::ResultSet) contact.should be_kind_of(ConstantContact::Components::Contact) end @@ -27,11 +27,11 @@ json = load_file('contact_response.json') net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK') response = RestClient::Response.create(json, net_http_resp, {}) RestClient.stub(:get).and_return(response) - contact = ConstantContact::Services::ContactService.get_contact('token', 1) + contact = ConstantContact::Services::ContactService.get_contact(1) contact.should be_kind_of(ConstantContact::Components::Contact) end end @@ -41,11 +41,11 @@ net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK') response = RestClient::Response.create(json, net_http_resp, {}) RestClient.stub(:post).and_return(response) new_contact = ConstantContact::Components::Contact.create(JSON.parse(json)) - contact = ConstantContact::Services::ContactService.add_contact('token', new_contact) + contact = ConstantContact::Services::ContactService.add_contact(new_contact) contact.should be_kind_of(ConstantContact::Components::Contact) contact.status.should eq('ACTIVE') end end @@ -56,11 +56,11 @@ net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content') response = RestClient::Response.create('', net_http_resp, {}) RestClient.stub(:delete).and_return(response) - result = ConstantContact::Services::ContactService.delete_contact('token', contact_id) + result = ConstantContact::Services::ContactService.delete_contact(contact_id) result.should be_true end end describe "#delete_contact_from_lists" do @@ -69,11 +69,11 @@ net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content') response = RestClient::Response.create('', net_http_resp, {}) RestClient.stub(:delete).and_return(response) - result = ConstantContact::Services::ContactService.delete_contact_from_lists('token', contact_id) + result = ConstantContact::Services::ContactService.delete_contact_from_lists(contact_id) result.should be_true end end describe "#delete_contact_from_list" do @@ -83,11 +83,11 @@ net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content') response = RestClient::Response.create('', net_http_resp, {}) RestClient.stub(:delete).and_return(response) - result = ConstantContact::Services::ContactService.delete_contact_from_list('token', contact_id, list_id) + result = ConstantContact::Services::ContactService.delete_contact_from_list(contact_id, list_id) result.should be_true end end describe "#update_contact" do @@ -96,10 +96,10 @@ net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK') response = RestClient::Response.create(json, net_http_resp, {}) RestClient.stub(:put).and_return(response) contact = ConstantContact::Components::Contact.create(JSON.parse(json)) - result = ConstantContact::Services::ContactService.update_contact('token', contact) + result = ConstantContact::Services::ContactService.update_contact(contact) result.should be_kind_of(ConstantContact::Components::Contact) result.status.should eq('ACTIVE') end end \ No newline at end of file