sms-spec 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.markdown +3 -0
- data/lib/sms_spec/data.rb +2 -2
- data/lib/sms_spec/drivers/twilio-ruby.rb +5 -7
- data/lib/sms_spec/matchers.rb +6 -0
- data/lib/sms_spec/version.rb +1 -1
- data/rails_generators/sms_spec/templates/sms_steps.rb +8 -0
- data/spec/drivers/clickatell_spec.rb +0 -1
- data/spec/drivers/twilio_spec.rb +3 -3
- data/spec/matchers_spec.rb +18 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c34ed4c16eee1805f81392619bf8c1600044f83
|
4
|
+
data.tar.gz: 4881f53d715ae43c5133da25cabf156928fa515d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3474a9046254133ab9bee3782217cf2ec8a7b47e1d34c2512009b72eaf2bf2af2d24373576af5bf38fa788e3bb06ca127775d2675a28f3c8949828ba6c4a6cd
|
7
|
+
data.tar.gz: 1f7792d5316d188d1a6a0c43edd286c238e4e365e68a6f53dc2a113d316e66b72a9df8def6bd7043ee1072d9dff474e657e5150dafaa1e6740308c6e345fabbe
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.2
|
data/README.markdown
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# SMS Spec
|
2
2
|
|
3
|
+
[](https://travis-ci.org/manlycode/sms-spec)
|
4
|
+
[](https://codeclimate.com/github/manlycode/sms-spec)
|
5
|
+
|
3
6
|
An RSpec DSL and Cucumber steps to test SMS interactions with your
|
4
7
|
Ruby on Rails application.
|
5
8
|
|
data/lib/sms_spec/data.rb
CHANGED
@@ -32,11 +32,11 @@ module SmsSpec
|
|
32
32
|
|
33
33
|
def self.open_last_text_message_for(phone_number)
|
34
34
|
message = messages_for(phone_number).first
|
35
|
-
@@current_text_message =
|
35
|
+
@@current_text_message = messages.delete(message)
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.messages_for(phone_number)
|
39
|
-
|
39
|
+
messages.select {|m| m.number == sanitize(phone_number)}
|
40
40
|
end
|
41
41
|
|
42
42
|
end
|
data/lib/sms_spec/matchers.rb
CHANGED
data/lib/sms_spec/version.rb
CHANGED
@@ -39,3 +39,11 @@ Then /^I should see the following in the text message body:$/ do |content|
|
|
39
39
|
current_text_message.should have_body(content)
|
40
40
|
end
|
41
41
|
|
42
|
+
Then /^I should see "([^"]*)" somewhere in the text message body$/ do |content|
|
43
|
+
current_text_message.should have_body_like(content)
|
44
|
+
end
|
45
|
+
|
46
|
+
Then /^I should see the following somewhere in the text message body:$/ do |content|
|
47
|
+
current_text_message.should have_body_like(content)
|
48
|
+
end
|
49
|
+
|
data/spec/drivers/twilio_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe SmsSpec do
|
|
17
17
|
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
18
18
|
|
19
19
|
@client = Twilio::REST::Client.new account_sid, auth_token
|
20
|
-
@client.account.
|
20
|
+
@client.account.messages.create(
|
21
21
|
:from => '+14159341234',
|
22
22
|
:to => '+16105557069',
|
23
23
|
:body => 'Hey there!'
|
@@ -32,7 +32,7 @@ describe SmsSpec do
|
|
32
32
|
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
33
33
|
|
34
34
|
@client = Twilio::REST::Client.new account_sid, auth_token
|
35
|
-
@client.account.
|
35
|
+
@client.account.messages.create(
|
36
36
|
:from => '+14159341234',
|
37
37
|
:to => '+16105557069',
|
38
38
|
:body => 'Hey there!'
|
@@ -49,7 +49,7 @@ describe SmsSpec do
|
|
49
49
|
auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
50
50
|
|
51
51
|
@client = Twilio::REST::Client.new account_sid, auth_token
|
52
|
-
@client.account.
|
52
|
+
@client.account.messages.create(
|
53
53
|
:from => '+14159341234',
|
54
54
|
:to => '+16105557069',
|
55
55
|
:body => 'Hey there!'
|
data/spec/matchers_spec.rb
CHANGED
@@ -67,4 +67,22 @@ describe SmsSpec::Matchers do
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
describe ".have_body_like" do
|
71
|
+
describe "when bodies partially match" do
|
72
|
+
it "matches" do
|
73
|
+
message = SmsSpec::Message.new(:number => mobile_number, :body => "something is here")
|
74
|
+
|
75
|
+
expect(have_body_like("something")).to match(message)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "when bodies don't partiall match" do
|
80
|
+
it "does not match" do
|
81
|
+
message = SmsSpec::Message.new(:number => mobile_number, :body => "something is here")
|
82
|
+
|
83
|
+
expect(have_body_like("godzilla")).to_not match(message)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
70
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Rittersdorf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project: sms-spec
|
138
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.4.1
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Test SMS interactions with RSpec and Cucumber
|
@@ -145,4 +145,3 @@ test_files:
|
|
145
145
|
- spec/helpers_spec.rb
|
146
146
|
- spec/matchers_spec.rb
|
147
147
|
- spec/spec_helper.rb
|
148
|
-
has_rdoc:
|