4info 1.2.4 → 1.2.5

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.
data/4info.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{4info}
8
- s.version = "1.2.4"
8
+ s.version = "1.2.5"
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"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.4
1
+ 1.2.5
data/lib/contactable.rb CHANGED
@@ -83,6 +83,7 @@ module FourInfo
83
83
  if response.success?
84
84
  self.four_info_sms_confirmation_code = response.confirmation_code
85
85
  self.four_info_sms_confirmation_attempted = Time.now.utc
86
+ self.four_info_sms_confirmed_phone_number = nil
86
87
  save
87
88
  else
88
89
  # "Confirmation Failed: #{response['message'].inspect}"
@@ -112,6 +112,19 @@ class FourInfoContactableTest < ActiveSupport::TestCase
112
112
  should_change "confirmed phone number attribute" do
113
113
  @user.four_info_sms_confirmed_phone_number
114
114
  end
115
+ context "and then attempting to confirm another number" do
116
+ setup {
117
+ @user.four_info_sms_phone_number = "206-555-5555"
118
+ FourInfo::Request.any_instance.expects(:perform).returns(ValidationSuccess).once
119
+ @user.send_sms_confirmation!
120
+ }
121
+ should "eliminate the previous confirmed phone number" do
122
+ assert @user.four_info_sms_confirmed_phone_number.blank?
123
+ end
124
+ should "un-confirm the record" do
125
+ assert !@user.sms_confirmed?
126
+ end
127
+ end
115
128
  end
116
129
  context "calling sms_confirm_with(wrong_code)" do
117
130
  setup { @worked = @user.sms_confirm_with('wrong_code') }
@@ -123,7 +136,7 @@ class FourInfoContactableTest < ActiveSupport::TestCase
123
136
  @user.four_info_sms_phone_number
124
137
  end
125
138
  should_not_change "confirmed phone number attribute" do
126
- @user.four_info_sms_confirmed_phone_number
139
+ @user.reload.four_info_sms_confirmed_phone_number
127
140
  end
128
141
  end
129
142
  end
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.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty