text_spec 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -2
- data/lib/text_spec/helpers.rb +23 -0
- data/lib/text_spec/version.rb +1 -1
- data/spec/drivers_spec.rb +1 -2
- data/spec/helpers_spec.rb +28 -0
- data/text_spec.gemspec +1 -1
- metadata +13 -14
data/README.markdown
CHANGED
data/lib/text_spec/helpers.rb
CHANGED
@@ -13,5 +13,28 @@ module TextSpec
|
|
13
13
|
:current_text_message,
|
14
14
|
:messages_for,
|
15
15
|
:open_last_text_message_for
|
16
|
+
|
17
|
+
def twiml_message(from, body, opts={})
|
18
|
+
base_options = {
|
19
|
+
"AccountSid"=>"1234567812345678",
|
20
|
+
"Body"=> body,
|
21
|
+
"ToZip"=>"94949",
|
22
|
+
"FromState"=>"MI",
|
23
|
+
"ToCity"=>"NOVATO",
|
24
|
+
"SmsSid"=>"1234567812345678",
|
25
|
+
"ToState"=>"CA",
|
26
|
+
"To"=>"8155552671",
|
27
|
+
"ToCountry"=>"US",
|
28
|
+
"FromCountry"=>"US",
|
29
|
+
"SmsMessageSid"=>"123456712345671234567",
|
30
|
+
"ApiVersion"=>"2008-08-01",
|
31
|
+
"FromCity"=>"GRAND RAPIDS",
|
32
|
+
"SmsStatus"=>"received",
|
33
|
+
"From"=> from,
|
34
|
+
"FromZip"=>"49507"
|
35
|
+
}
|
36
|
+
|
37
|
+
base_options.merge! opts
|
38
|
+
end
|
16
39
|
end
|
17
40
|
end
|
data/lib/text_spec/version.rb
CHANGED
data/spec/drivers_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), *%w[spec_helper])
|
2
1
|
require 'twilio-ruby'
|
2
|
+
require File.join(File.dirname(__FILE__), *%w[spec_helper])
|
3
3
|
|
4
4
|
describe TextSpec do
|
5
5
|
include TextSpec::Helpers
|
@@ -8,7 +8,6 @@ describe TextSpec do
|
|
8
8
|
TextSpec::Data.clear_messages
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
11
|
describe "the twilio-ruby driver" do
|
13
12
|
it "is assignable" do
|
14
13
|
TextSpec.driver = :"twilio-ruby"
|
data/spec/helpers_spec.rb
CHANGED
@@ -90,7 +90,35 @@ describe TextSpec::Helpers do
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe ".twiml_message" do
|
96
|
+
context "with defaults" do
|
97
|
+
let(:message) {
|
98
|
+
twiml_message("+16165559982", "Ahoy!")
|
99
|
+
}
|
100
|
+
|
101
|
+
it "modifies the From attribute" do
|
102
|
+
message["From"].should eql("+16165559982")
|
103
|
+
end
|
104
|
+
|
105
|
+
it "Modifies the Body attribute" do
|
106
|
+
message["Body"].should eql("Ahoy!")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe "Overriding options" do
|
111
|
+
let(:message) {
|
112
|
+
twiml_message("+16165559982", "Ahoy!", "ToZip" => "49506", "ToCity" => "Detroit")
|
113
|
+
}
|
93
114
|
|
115
|
+
it "overrides the specified attributes" do
|
116
|
+
message["ToZip"].should eql("49506")
|
117
|
+
message["ToCity"].should eql("Detroit")
|
118
|
+
message["Body"].should eql("Ahoy!")
|
119
|
+
message["From"].should eql("+16165559982")
|
120
|
+
end
|
121
|
+
end
|
94
122
|
end
|
95
123
|
|
96
124
|
end
|
data/text_spec.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["manlycode@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/mhs/text_spec"
|
11
11
|
s.summary = %q{Test SMS interactions with RSpec and Cucumber}
|
12
|
-
s.description = %q{Text Spec gives you an RSpec DSL and Cucumber steps to test SMS interactions
|
12
|
+
s.description = %q{Text Spec gives you an RSpec DSL and Cucumber steps to test SMS interactions.}
|
13
13
|
|
14
14
|
s.rubyforge_project = "text_spec"
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: text_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2168665540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2168665540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &2168665000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2168665000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: twilio-ruby
|
38
|
-
requirement: &
|
38
|
+
requirement: &2168664440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2168664440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: guard-rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &2168663980 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2168663980
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: pry
|
60
|
-
requirement: &
|
60
|
+
requirement: &2168663500 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,9 +65,8 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
69
|
-
description: Text Spec gives you an RSpec DSL and Cucumber steps to test SMS interactions
|
70
|
-
(currently only usint the twilio-rb gem).
|
68
|
+
version_requirements: *2168663500
|
69
|
+
description: Text Spec gives you an RSpec DSL and Cucumber steps to test SMS interactions.
|
71
70
|
email:
|
72
71
|
- manlycode@gmail.com
|
73
72
|
executables: []
|