test/client_test.rb in createsend-5.0.0 vs test/client_test.rb in createsend-5.1.0
- old
+ new
@@ -81,11 +81,11 @@
lists.first.Name.should == 'List One'
end
should "get all lists to which a subscriber with a particular email address belongs" do
email = "valid@example.com"
- stub_get(@auth, "clients/#{@client.client_id}/listsforemail.json?email=#{CGI.escape(email)}", "listsforemail.json")
+ stub_get(@auth, "clients/#{@client.client_id}/listsforemail.json?email=#{ERB::Util.url_encode(email)}", "listsforemail.json")
lists = @client.lists_for_email(email)
lists.size.should == 2
lists.first.ListID.should == 'ab4a2b57c7c8f1ba62f898a1af1a575b'
lists.first.ListName.should == 'List Number One'
lists.first.SubscriberState.should == 'Active'
@@ -129,11 +129,11 @@
result = @client.suppress [ "one@example.com", "two@example.com" ]
end
should "unsuppress an email address" do
email = "example@example.com"
- stub_put(@auth, "clients/#{@client.client_id}/unsuppress.json?email=#{CGI.escape(email)}", nil)
+ stub_put(@auth, "clients/#{@client.client_id}/unsuppress.json?email=#{ERB::Util.url_encode(email)}", nil)
result = @client.unsuppress email
end
should "get all people" do
stub_get(@auth, "clients/#{@client.client_id}/people.json", "people.json")
@@ -153,11 +153,11 @@
templates.first.Name.should == 'Template One'
end
should "set primary contact" do
email = 'person@blackhole.com'
- stub_put(@auth, "clients/#{@client.client_id}/primarycontact.json?email=#{CGI.escape(email)}", 'client_set_primary_contact.json')
+ stub_put(@auth, "clients/#{@client.client_id}/primarycontact.json?email=#{ERB::Util.url_encode(email)}", 'client_set_primary_contact.json')
result = @client.set_primary_contact email
result.EmailAddress.should == email
end
should "get primary contact" do
@@ -215,8 +215,16 @@
should "delete a client" do
stub_delete(@auth, "clients/#{@client.client_id}.json", nil)
@client.delete
end
-
+
+ should "get all journeys" do
+ stub_get(@auth, "clients/#{@client.client_id}/journeys.json", "journeys.json")
+ lists = @client.journeys
+ lists.size.should == 3
+ lists.first.ListID.should == 'a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a'
+ lists.first.Name.should == 'Journey One'
+ lists.first.Status.should == 'Not started'
+ end
end
end