4info 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/4info.gemspec +2 -2
- data/VERSION +1 -1
- data/lib/contactable.rb +1 -1
- data/test/four_info_contactable_test.rb +19 -2
- metadata +2 -2
data/4info.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{4info}
|
8
|
-
s.version = "1.3.
|
8
|
+
s.version = "1.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jack Danger Canty"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-21}
|
13
13
|
s.description = %q{A complete Ruby API for handling SMS messages via 4info.com}
|
14
14
|
s.email = %q{gitcommit@6brand.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
data/lib/contactable.rb
CHANGED
@@ -106,7 +106,7 @@ module FourInfo
|
|
106
106
|
# code. If they match then the current phone number is set
|
107
107
|
# as confirmed by the user.
|
108
108
|
def sms_confirm_with(code)
|
109
|
-
if four_info_sms_confirmation_code == code
|
109
|
+
if four_info_sms_confirmation_code.downcase == code.downcase
|
110
110
|
# save the phone number into the 'confirmed phone number' attribute
|
111
111
|
self.four_info_sms_confirmed_phone_number = four_info_sms_phone_number
|
112
112
|
save
|
@@ -12,7 +12,7 @@ class FourInfoContactableTest < ActiveSupport::TestCase
|
|
12
12
|
ValidationSuccess = '<?xml version=”1.0” ?>
|
13
13
|
<response>
|
14
14
|
<requestId>F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6</requestId>
|
15
|
-
<confCode>
|
15
|
+
<confCode>123ABC</confCode>
|
16
16
|
<status>
|
17
17
|
<id>1</id>
|
18
18
|
<message>Success</message>
|
@@ -89,7 +89,7 @@ class FourInfoContactableTest < ActiveSupport::TestCase
|
|
89
89
|
}
|
90
90
|
should "work" do assert @worked end
|
91
91
|
should "save confirmation number in proper attribute" do
|
92
|
-
assert_equal '
|
92
|
+
assert_equal '123ABC', @user.four_info_sms_confirmation_code
|
93
93
|
end
|
94
94
|
should "set confirmation attempted time" do
|
95
95
|
assert @user.four_info_sms_confirmation_attempted > 3.minutes.ago
|
@@ -126,6 +126,23 @@ class FourInfoContactableTest < ActiveSupport::TestCase
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
129
|
+
context "calling sms_confirm_with(right code, wrong case)" do
|
130
|
+
setup {
|
131
|
+
@downcased_code = @user.four_info_sms_confirmation_code.downcase
|
132
|
+
@worked = @user.sms_confirm_with(@downcased_code)
|
133
|
+
}
|
134
|
+
should "have good test data" do
|
135
|
+
assert_not_equal @downcased_code,
|
136
|
+
@user.four_info_sms_confirmation_code
|
137
|
+
end
|
138
|
+
should "work" do
|
139
|
+
assert @worked
|
140
|
+
end
|
141
|
+
should "save the phone number into the confirmed attribute" do
|
142
|
+
assert_equal @user.four_info_sms_confirmed_phone_number,
|
143
|
+
@user.four_info_sms_phone_number
|
144
|
+
end
|
145
|
+
end
|
129
146
|
context "calling sms_confirm_with(wrong_code)" do
|
130
147
|
setup { @worked = @user.sms_confirm_with('wrong_code') }
|
131
148
|
should "not work" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 4info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Danger Canty
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-21 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|