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 +1 -1
- data/VERSION +1 -1
- data/lib/contactable.rb +1 -0
- data/test/four_info_contactable_test.rb +14 -1
- metadata +1 -1
    
        data/4info.gemspec
    CHANGED
    
    
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.2. | 
| 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
         |