spec/unit/mailgun_spec.rb in mailgun-ruby-1.1.1 vs spec/unit/mailgun_spec.rb in mailgun-ruby-1.1.2
- old
+ new
@@ -23,13 +23,13 @@
expect {@mg_obj.send_message("test.com", @mh_obj)}.not_to raise_error
end
it 'sends a message' do
data = { 'from' => 'joe@test.com',
- 'to' => 'bob@example.com',
- 'subject' => 'Test',
- 'text' => 'Test Data'}
+ 'to' => 'bob@example.com',
+ 'subject' => 'Test',
+ 'text' => 'Test Data' }
result = @mg_obj.send_message("testdomain.com", data)
result.to_h!
expect(result.body).to include("message")
@@ -40,11 +40,11 @@
data = {'to' => 'joe@test.com',
'message' => 'Sample Data/mime.txt'}
result = @mg_obj.send_message("testdomain.com", data)
result.to_h!
-
+
expect(result.body).to include("message")
expect(result.body).to include("id")
end
end
@@ -59,11 +59,11 @@
'subject' => 'Test',
'text' => 'Test Data'}
result = @mg_obj.post("#{@domain}/messages", data)
result.to_h!
-
+
expect(result.body).to include("message")
expect(result.body).to include("id")
end
end
@@ -79,11 +79,11 @@
data = {'subscribed' => false,
'name' => 'Foo Bar'}
result = @mg_obj.put("lists/#{@list_address}/members#{@member_address}", data)
result.to_h!
-
+
expect(result.body).to include("member")
expect(result.body["member"]).to include("vars")
expect(result.body["member"]["vars"]).to include("age")
expect(result.body["member"]).to include("name")
expect(result.body["member"]).to include("subscribed")
@@ -102,11 +102,11 @@
query_string = {'skip' => '10',
'limit' => '5'}
result = @mg_obj.get("#{@domain}/bounces", query_string)
result.to_h!
-
+
expect(result.body).to include("total_count")
expect(result.body).to include("items")
end
end
@@ -118,10 +118,10 @@
it 'issues a generic delete request.' do
result = @mg_obj.delete("#{@domain}/campaigns/ABC123")
result.to_h!
-
+
expect(result.body).to include("message")
expect(result.body).to include("id")
end
end