Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add specs for Logs#all with actual results.

  • Loading branch information...
commit 10376458af0dacd64ab5a150f69d694d5a84b442 1 parent 7b2b5ea
@tylerhunt authored
Showing with 115 additions and 7 deletions.
  1. +102 −5 spec/fixtures/logs.yml
  2. +13 −2 spec/pew_pew/resources/logs_spec.rb
View
107 spec/fixtures/logs.yml
@@ -19,18 +19,115 @@ http_interactions:
server:
- nginx/1.0.14
date:
- - Thu, 24 May 2012 06:01:06 GMT
+ - Fri, 01 Jun 2012 20:04:42 GMT
content-type:
- application/json
connection:
- close
content-length:
- - '37'
+ - '7529'
content-disposition:
- inline
body:
encoding: US-ASCII
- string: ! "{\n \"total_count\": 0,\n \"items\": []\n}"
+ string: ! "{\n \"total_count\": 27,\n \"items\": [\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 04:19:04 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"4fc84273c474_48dd3fe70cc34cd05949d@rouge.local.mail\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 01 Jun 2012 04:18:13 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc84273c474_48dd3fe70cc34cd05949d@rouge.local.mail\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 04:17:50 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"4fc8417721270_489e3fcfe0c34cdc352b0@rouge.local.mail\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 01 Jun 2012 04:17:13 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc8417721270_489e3fcfe0c34cdc352b0@rouge.local.mail\"\n },\n {\n
+ \ \"hap\": \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 04:13:38
+ GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192
+ pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc83d2449eb4_47b53fde6d034cd45631b@rouge.local.mail\"\n },\n {\n
+ \ \"hap\": \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 04:02:20
+ GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192
+ pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc83d2449eb4_47b53fde6d034cd45631b@rouge.local.mail\"\n },\n {\n
+ \ \"hap\": \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 04:00:48
+ GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192
+ pewpew@devoh.com 'First multipart email sent with Mail'\",\n \"type\":
+ \"info\",\n \"message_id\": \"4a914f12ac7e_6f0f1ab80267d1@baci.local.mail\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 01 Jun 2012 03:55:39 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc83d2449eb4_47b53fde6d034cd45631b@rouge.local.mail\"\n },\n {\n
+ \ \"hap\": \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 03:51:11
+ GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192
+ pewpew@devoh.com\",\n \"type\": \"info\",\n \"message_id\": \"4fc83bfe82f0c_476b3fe22a034cdc9632@rouge.local.mail\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 01 Jun 2012 03:39:14 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com\",\n \"type\": \"info\",\n \"message_id\":
+ \"4fc8389b8df7a_466c3fc7ba034cd08198@rouge.local.mail\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Fri, 01 Jun 2012 03:30:30 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120601033029.22201.2429@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Tue,
+ 29 May 2012 23:45:27 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120529234526.13436.15849@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Tue, 29 May 2012 23:42:42 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120529234242.4549.55626@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Tue,
+ 29 May 2012 23:32:57 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120529233255.4549.55955@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Tue, 29 May 2012 23:32:56 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120529233255.4549.8763@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Tue,
+ 29 May 2012 23:32:26 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120529233225.4550.44296@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Tue, 29 May 2012 23:22:23 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120529232222.4550.70051@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Sat,
+ 26 May 2012 06:19:26 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120526061924.23647.42796@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Sat, 26 May 2012 06:17:00 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120526061658.23646.95976@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Sat,
+ 26 May 2012 00:12:08 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120526001207.15875.46370@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Sat, 26 May 2012 00:04:14 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120526000412.15874.5241@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Sat,
+ 26 May 2012 00:01:25 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120526000124.17887.97367@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Fri, 25 May 2012 23:58:05 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120525235750.3879.83431@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 25 May 2012 23:57:51 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120525235751.17887.20819@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Fri, 25 May 2012 23:57:50 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120525235749.3878.6294@pewpew.mailgun.org\"\n
+ \ },\n {\n \"hap\": \"delivered\",\n \"created_at\": \"Fri,
+ 25 May 2012 23:57:49 GMT\",\n \"message\": \"Delivered: postmaster@pewpew.mailgun.org
+ \\u2192 pewpew@devoh.com 'Test'\",\n \"type\": \"info\",\n \"message_id\":
+ \"20120525235748.23647.26762@pewpew.mailgun.org\"\n },\n {\n \"hap\":
+ \"delivered\",\n \"created_at\": \"Thu, 24 May 2012 08:00:45 GMT\",\n
+ \ \"message\": \"Delivered: postmaster@pewpew.mailgun.org \\u2192 pewpew@devoh.com
+ 'Test'\",\n \"type\": \"info\",\n \"message_id\": \"20120524080044.27067.73085@pewpew.mailgun.org\"\n
+ \ }\n ]\n}"
http_version:
- recorded_at: Thu, 24 May 2012 06:01:06 GMT
-recorded_with: VCR 2.1.1
+ recorded_at: Fri, 01 Jun 2012 20:04:42 GMT
+recorded_with: VCR 2.2.0
View
15 spec/pew_pew/resources/logs_spec.rb
@@ -1,3 +1,5 @@
+# encoding: UTF-8
+
require 'spec_helper'
describe PewPew::Resources::Logs, :resource do
@@ -26,7 +28,16 @@
specify { should be_success }
its(:status) { should == 200 }
- its(:total_count) { should == 0 }
- its(:items) { should == [] }
+ its(:total_count) { should == 27 }
+
+ context 'item' do
+ subject { response.items.first }
+
+ its(:created_at) { should == 'Fri, 01 Jun 2012 04:19:04 GMT' }
+ its(:hap) { should == 'delivered' }
+ its(:message) { should == "Delivered: postmaster@pewpew.mailgun.org → pewpew@devoh.com 'Test'" }
+ its(:message_id) { should == '4fc84273c474_48dd3fe70cc34cd05949d@rouge.local.mail' }
+ its(:type) { should == 'info' }
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.