validates_captcha 0.9.5 → 0.9.6

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.
@@ -1,24 +1,24 @@
1
1
  require 'test_helper'
2
-
2
+
3
3
  SE = ValidatesCaptcha::SymmetricEncryptor::Simple
4
-
4
+
5
5
  class SymmetricEncryptorTest < ValidatesCaptcha::TestCase
6
6
  test "defines an instance level #encrypt method" do
7
7
  assert_respond_to SE.new, :encrypt
8
8
  end
9
-
9
+
10
10
  test "instance level #encrypt method returns a string" do
11
11
  assert_kind_of String, SE.new.encrypt('abc')
12
12
  end
13
-
13
+
14
14
  test "defines an instance level #decrypt method" do
15
15
  assert_respond_to SE.new, :decrypt
16
16
  end
17
-
17
+
18
18
  test "instance level #decrypt method returns nil if decryption failes" do
19
19
  assert_nil SE.new.decrypt('invalid')
20
20
  end
21
-
21
+
22
22
  test "decryption of encryption of string should equal the string" do
23
23
  %w(d3crypti0n 3ncrypt3d 5trin9 sh0u1d equ41 th3 c4ptch4).each do |captcha|
24
24
  assert_equal captcha, SE.new.decrypt(SE.new.encrypt(captcha))
@@ -4,25 +4,26 @@ class ValidatesCaptchaTest < ValidatesCaptcha::TestCase
4
4
  test "defines a class level #version method" do
5
5
  assert_respond_to ValidatesCaptcha, :version
6
6
  end
7
-
7
+
8
8
  test "class level #version method returns a valid version" do
9
9
  assert_match /^\d+\.\d+\.\w+$/, ValidatesCaptcha.version
10
10
  end
11
-
11
+
12
12
  test "defines a class level #provider method" do
13
13
  assert_respond_to ValidatesCaptcha, :provider
14
14
  end
15
-
15
+
16
16
  test "defines a class level #provider= method" do
17
17
  assert_respond_to ValidatesCaptcha, :provider=
18
18
  end
19
-
19
+
20
20
  test "#provider method's return value should equal the value set using the #provider= method" do
21
21
  old_provider = ValidatesCaptcha.provider
22
-
22
+
23
23
  ValidatesCaptcha.provider = 'abc'
24
24
  assert_equal 'abc', ValidatesCaptcha.provider
25
-
25
+
26
26
  ValidatesCaptcha.provider = old_provider
27
27
  end
28
28
  end
29
+
data/test/test_helper.rb CHANGED
@@ -13,14 +13,18 @@ end
13
13
 
14
14
  require 'active_record'
15
15
 
16
+ ActiveRecord::Base.logger = Logger.new(nil)
16
17
  ActiveRecord::Schema.verbose = false
17
18
  ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
18
19
  ActiveRecord::Schema.define :version => 1 do
19
20
  create_table :widgets do |t|
21
+ t.string :name
20
22
  end
21
23
  end
22
24
 
23
25
  class Widget < ActiveRecord::Base
24
26
  include ValidatesCaptcha::ModelValidation
27
+
28
+ attr_accessible :name
25
29
  end
26
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Andert
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 +02:00
12
+ date: 2009-10-30 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -79,7 +79,7 @@ licenses: []
79
79
  post_install_message:
80
80
  rdoc_options:
81
81
  - --title
82
- - Validates Captcha 0.9.5
82
+ - Validates Captcha 0.9.6
83
83
  - --main
84
84
  - README.rdoc
85
85
  - --line-numbers