4info 1.1.0 → 1.1.1

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.1.0"
8
+ s.version = "1.1.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"]
data/README.markdown CHANGED
@@ -34,6 +34,8 @@ You can manage the user's SMS state like so:
34
34
  @user.confirm_sms!
35
35
  # then ask the user for the confirmation code and
36
36
  # compare it to @user.sms_confirmation_code
37
+ # if they're the same, call
38
+ @user.sms_confirmed!
37
39
  @user.update_attributes(:sms_confirmed_phone_number => @user.sms_phone_number)
38
40
  @user.send_sms!("Hi! This is a text message.")
39
41
  # Then maybe the user will reply with 'BLOCK' by accident
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/lib/contactable.rb CHANGED
@@ -75,6 +75,11 @@ module FourInfo
75
75
  end
76
76
  end
77
77
 
78
+ def sms_confirmed!
79
+ # save the phone number into the 'confirmed phone number' attribute
80
+ four_info_sms_confirmed_phone_number four_info_sms_phone_number
81
+ end
82
+
78
83
  def unblock_sms!
79
84
  return false unless four_info_sms_blocked?
80
85
 
@@ -97,6 +97,16 @@ class FourInfoContactableTest < ActiveSupport::TestCase
97
97
  should "not have number confirmed yet" do
98
98
  assert !@user.current_phone_number_confirmed_for_sms?
99
99
  end
100
+ context "calling sms_confirmed!" do
101
+ setup { @user.sms_confirmed! }
102
+ should "save the phone number into the confirmed attribute" do
103
+ assert_equal @user.four_info_sms_confirmed_phone_number,
104
+ @user.four_info_sms_phone_number
105
+ end
106
+ should_change "confirmed phone number attribuet" do
107
+ @user.four_info_sms_confirmed_phone_number
108
+ end
109
+ end
100
110
  end
101
111
  context "confirming phone number when the confirmation fails for some reason" do
102
112
  setup {
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty