active_model-email_confirmation 1.0.0 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbbd8c6fd557d779d89dbaa280361da273368eed
4
- data.tar.gz: aa48ed884b58b84e9085d2bcfc8a9c0be1e21086
3
+ metadata.gz: f4b06a84e3ac284fe84a00dc54de69c72b251c64
4
+ data.tar.gz: f2ae4089f99041fcc117d6d5c8148e5e0cde4906
5
5
  SHA512:
6
- metadata.gz: 98641f6d16d2ffbd31498617255165f0139c4fc758b5e6c7872d092815a4154bb341abbfb19bc26769dfe353db9895087afd1c1e028323e192580aac72d4a26f
7
- data.tar.gz: f2a10b220d387bf551ec27ba3079ff601a8117ea006214840cf9d890e76d2e36c5f7a9c108e5343c8463bd0b2585ec112cd4f1934fb6a6aad2b4f63ee747a0a3
6
+ metadata.gz: 84e5a470e9ebd95f1a3a9814eb7c0b81a7a03f28b6aa7d9463299c24993212275854639a11cf464087a54fcd06c0018d25dd82d8272d2779cac566b7253dacfe
7
+ data.tar.gz: 4011dc93873b94d0c3c8b2ba0b5a0369ff2387375f2297b40abd53feb2e085264c5ea88c50dfac49c93f30f23179698f6e361de5202597bb4e9e17bc73ed533f
@@ -43,6 +43,8 @@ module ActiveModel
43
43
  end
44
44
 
45
45
  def self.verify_token(string)
46
+ raise TokenInvalid if string.nil?
47
+
46
48
  message_verifier.verify(Base64.urlsafe_decode64(string))
47
49
  rescue ActiveSupport::MessageVerifier::InvalidSignature, ArgumentError
48
50
  raise TokenInvalid
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class EmailConfirmation
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ module ActiveModel
26
26
  end
27
27
  end
28
28
 
29
- class EmailConfirmationTest < Test::Unit::TestCase
29
+ class EmailConfirmationTest < Minitest::Test
30
30
  include ActiveModel::Lint::Tests
31
31
 
32
32
  def setup
@@ -68,4 +68,8 @@ class EmailConfirmationTest < Test::Unit::TestCase
68
68
  def test_find_raises_exception_with_non_base64_token
69
69
  assert_raises(ActiveModel::EmailConfirmation::TokenInvalid) { ActiveModel::EmailConfirmation.find("%%%%%%%%%") }
70
70
  end
71
+
72
+ def test_find_raises_exception_with_nil_token
73
+ assert_raises(ActiveModel::EmailConfirmation::TokenInvalid) { ActiveModel::EmailConfirmation.find(nil) }
74
+ end
71
75
  end
@@ -1,3 +1,3 @@
1
- require "test/unit"
1
+ require "minitest/autorun"
2
2
  require "active_model/email_confirmation"
3
3
  require "ostruct"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model-email_confirmation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuba Kuźma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.2.0
93
+ rubygems_version: 2.4.1
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Simple email confirmation model implemented on top of ActiveModel::Model