Skip to content

Commit fe2dd5f

Browse files
committed
cleaning up the tests: it was the same response for each call anyway
1 parent 24c59df commit fe2dd5f

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

spec/pardot/objects/emails_spec.rb

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,7 @@
66
@client = create_client
77
end
88

9-
def sample_email
10-
%(<?xml version="1.0" encoding="UTF-8"?>\n<rsp stat="ok" version="1.0">
11-
<email>
12-
<name>My Email</name>
13-
</email>
14-
</rsp>)
15-
end
16-
17-
def sample_send_to_prospect
18-
%(<?xml version="1.0" encoding="UTF-8"?>\n<rsp stat="ok" version="1.0">
19-
<email>
20-
<name>My Email</name>
21-
</email>
22-
</rsp>)
23-
end
24-
25-
def sample_send_to_list
9+
def sample_response
2610
%(<?xml version="1.0" encoding="UTF-8"?>\n<rsp stat="ok" version="1.0">
2711
<email>
2812
<name>My Email</name>
@@ -35,17 +19,17 @@ def sample_send_to_list
3519
end
3620

3721
it "should take in the email ID" do
38-
fake_get "/api/email/version/3/do/read/id/12?user_key=bar&api_key=my_api_key&format=simple", sample_email
22+
fake_get "/api/email/version/3/do/read/id/12?user_key=bar&api_key=my_api_key&format=simple", sample_response
3923
@client.emails.read_by_id(12).should == {"name" => "My Email"}
4024
end
4125

4226
it 'should send to a prospect' do
43-
fake_post '/api/email/version/3/do/send/prospect_id/42?campaign_id=765&email_template_id=86&user_key=bar&api_key=my_api_key&format=simple', sample_send_to_prospect
27+
fake_post '/api/email/version/3/do/send/prospect_id/42?campaign_id=765&email_template_id=86&user_key=bar&api_key=my_api_key&format=simple', sample_response
4428
@client.emails.send_to_prospect(42, :campaign_id => 765, :email_template_id => 86).should == {"name" => "My Email"}
4529
end
4630

4731
it 'should send to a list' do
48-
fake_post '/api/email/version/3/do/send?email_template_id=200&list_ids[]=235&campaign_id=654&user_key=bar&api_key=my_api_key&format=simple', sample_send_to_list
32+
fake_post '/api/email/version/3/do/send?email_template_id=200&list_ids[]=235&campaign_id=654&user_key=bar&api_key=my_api_key&format=simple', sample_response
4933
@client.emails.send_to_list(:email_template_id => 200, 'list_ids[]' => 235, :campaign_id => 654).should == {"name" => "My Email"}
5034
end
5135

0 commit comments

Comments
 (0)