mailstro 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfb6f6f8d8402d20a20f56153d3cab92a269f810
4
- data.tar.gz: 91bebe9ce5c5c57ba696b558efaa9345f4224b1d
3
+ metadata.gz: bf855e15283478602f514d022748a103f567ea4d
4
+ data.tar.gz: a9574d49338b69186a9d3944a2b2222fa58e4fd5
5
5
  SHA512:
6
- metadata.gz: 442beb7b0c5cd4455dd7ea909c10b34cda4a7ef09dad54f27ffbff8f46379661fb1dc42f0df60ff4e551b39cd457d80942ad9494ecde1e6363c4753d13cdb03f
7
- data.tar.gz: 7e06752aac384dd4b78e0e26db7670991cf25344e5055a4b51513d80c2e0a37bdfde9a8f5e69230baeff0e5d225e533456698ebeca83781d112bea73bade88a0
6
+ metadata.gz: 2a529d88fe60006764f3d8219b9c88b271190fab3edd704a6d501e80d3ded776ae58a1c84342c79710626f413ae6a90d619bf676eb046c81f9d72e0d88f4e72b
7
+ data.tar.gz: b48beeb0cd6a31fbd2bb913e325832db8235eb499a0ecf00c191b984b7154687244a855660cac1e0ceee2826b567f8b5d5c0c799366b27a27963047506f8327e
@@ -7,7 +7,7 @@ module Mailstro
7
7
 
8
8
  def initialize
9
9
  @use_ssl = true
10
- @endpoint = 'api.mailstro.co'
10
+ @endpoint = 'api.mailstroapp.com'
11
11
  @api_version = 1
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module Mailstro
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
+ spec.add_development_dependency "vcr"
24
25
  end
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://ENDPOINT/v1/postman
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"template":"test","recipient":{"email":"test@example.com"},"api_key":"API_KEY","payload":{"greeting":"Gday!"}}'
9
+ headers:
10
+ Content-Type:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - '*/*'
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ X-Frame-Options:
24
+ - SAMEORIGIN
25
+ X-Xss-Protection:
26
+ - 1; mode=block
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ X-Ua-Compatible:
30
+ - chrome=1
31
+ X-Xhr-Current-Location:
32
+ - /v1/postman
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Etag:
36
+ - '"82380d1e263b6093f3c7535690fcdd75"'
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ Set-Cookie:
40
+ - request_method=POST; path=/
41
+ X-Request-Id:
42
+ - 7c8249cb-b3d6-4108-8a97-dba45471019a
43
+ X-Runtime:
44
+ - '0.084302'
45
+ Vary:
46
+ - Accept-Encoding
47
+ Connection:
48
+ - close
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"ok":true}'
52
+ http_version:
53
+ recorded_at: Tue, 21 May 2013 10:17:29 GMT
54
+ recorded_with: VCR 2.5.0
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Mailstro::Delivery, :integration do
3
+ describe 'posting a delivery', :integration do
4
4
  let(:template) { :test }
5
5
  let(:recipient) { { :email => "test@example.com" } }
6
6
  let(:payload) { { :greeting => "Gday!" } }
@@ -14,8 +14,7 @@ describe Mailstro::Delivery, :integration do
14
14
  end
15
15
  end
16
16
 
17
- it "succesfully submits a delivery to mailstro" do
18
- pending
17
+ it "succesfully submits a delivery to mailstro", :vcr do
19
18
  response = Mailstro.deliver(template, :recipient => recipient, :payload => payload)
20
19
  response['ok'].should == true
21
20
  end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,16 @@
1
1
  require 'mailstro'
2
2
 
3
+ SPEC_PATH = Pathname.new(File.expand_path('..', __FILE__))
4
+ FIXTURES_PATH = SPEC_PATH.join('fixtures')
5
+
6
+ Dir[SPEC_PATH.join("support/**/*.rb")].each { |f| require f }
7
+
3
8
  RSpec.configure do |config|
4
9
  config.treat_symbols_as_metadata_keys_with_true_values = true
5
- config.run_all_when_everything_filtered = true
6
- config.filter_run :focus
7
10
 
8
- config.order = 'random'
11
+ # Run specs in random order to surface order dependencies. If you find an
12
+ # order dependency and want to debug it, you can fix the order by providing
13
+ # the seed, which is printed after each run.
14
+ # --seed 1234
15
+ config.order = "random"
9
16
  end
@@ -0,0 +1,9 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |config|
4
+ config.cassette_library_dir = FIXTURES_PATH.join('cassettes')
5
+ config.hook_into :webmock
6
+ config.filter_sensitive_data('API_KEY') { ENV['MAILSTRO_API_KEY'] }
7
+ config.filter_sensitive_data('ENDPOINT') { ENV['MAILSTRO_ENDPOINT'] }
8
+ config.configure_rspec_metadata!
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailstro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-20 00:00:00.000000000 Z
11
+ date: 2013-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Ruby notifier for mailstro.co
56
70
  email:
57
71
  - me@keithpitt.com
@@ -73,13 +87,15 @@ files:
73
87
  - lib/mailstro/test.rb
74
88
  - lib/mailstro/version.rb
75
89
  - mailmask-ruby.gemspec
76
- - spec/integration/delivery_spec.rb
90
+ - spec/fixtures/cassettes/posting_a_delivery/succesfully_submits_a_delivery_to_mailstro.yml
91
+ - spec/integration/posting_a_delivery_spec.rb
77
92
  - spec/mailstro/configuration_spec.rb
78
93
  - spec/mailstro/delivery_spec.rb
79
94
  - spec/mailstro/test_spec.rb
80
95
  - spec/mailstro/version_spec.rb
81
96
  - spec/mailstro_spec.rb
82
97
  - spec/spec_helper.rb
98
+ - spec/support/vcr.rb
83
99
  homepage: http://www.mailstro.co
84
100
  licenses:
85
101
  - MIT
@@ -105,10 +121,12 @@ signing_key:
105
121
  specification_version: 4
106
122
  summary: Ruby notifier for mailstro.co
107
123
  test_files:
108
- - spec/integration/delivery_spec.rb
124
+ - spec/fixtures/cassettes/posting_a_delivery/succesfully_submits_a_delivery_to_mailstro.yml
125
+ - spec/integration/posting_a_delivery_spec.rb
109
126
  - spec/mailstro/configuration_spec.rb
110
127
  - spec/mailstro/delivery_spec.rb
111
128
  - spec/mailstro/test_spec.rb
112
129
  - spec/mailstro/version_spec.rb
113
130
  - spec/mailstro_spec.rb
114
131
  - spec/spec_helper.rb
132
+ - spec/support/vcr.rb