dm-devise 1.1.4 → 1.1.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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dm-devise (1.1.3)
4
+ dm-devise (1.1.4)
5
5
  bcrypt-ruby (~> 2.1.2)
6
6
  devise (~> 1.1.0)
7
7
  dm-core (~> 1.0.0)
data/README.rdoc CHANGED
@@ -20,9 +20,7 @@ earlier versions, but it's not been tested (if you try, please let Jared Morgan
20
20
  This README only covers dm-devise specifics. Make sure to read the devise
21
21
  README http://github.com/plataformatec/devise/blob/master/README.rdoc
22
22
 
23
- Last tested against devise release: v1.1.1
24
-
25
- Last tested against devise master: 2010-09-25, commit 2aa1d2f3b76ce87c087a010c02d78a1156ac8669
23
+ Last tested against devise release: v1.1.3
26
24
 
27
25
  == Installation
28
26
 
data/dm-devise.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dm-devise}
8
- s.version = "1.1.4"
8
+ s.version = "1.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jared Morgan"]
12
- s.date = %q{2010-10-16}
12
+ s.date = %q{2010-11-12}
13
13
  s.description = %q{dm-devise adds DataMapper support to devise (http://github.com/plataformatec/devise) for authentication support for Rails}
14
14
  s.email = %q{jmorgan@morgancreative.net}
15
15
  s.extra_rdoc_files = [
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
35
35
  "lib/dm-devise/version.rb",
36
36
  "lib/generators/data_mapper/devise_generator.rb",
37
37
  "test/data_mapper/compatibility_test.rb",
38
+ "test/data_mapper/schema_test.rb",
38
39
  "test/orm/data_mapper.rb",
39
40
  "test/orm/data_mapper_active_model.rb",
40
41
  "test/overrides/data_mapper_test.rb",
@@ -55,6 +56,7 @@ Gem::Specification.new do |s|
55
56
  s.summary = %q{Support for using DataMapper ORM with devise}
56
57
  s.test_files = [
57
58
  "test/test_helper.rb",
59
+ "test/data_mapper/schema_test.rb",
58
60
  "test/data_mapper/compatibility_test.rb",
59
61
  "test/rails_app/config/environment.rb",
60
62
  "test/rails_app/config/application.rb",
@@ -28,6 +28,8 @@ module Devise
28
28
  if String == type && !options[:length]
29
29
  options[:length] = 255
30
30
  end
31
+
32
+ options[:required] ||= false
31
33
 
32
34
  options.delete(:default) if options[:default].nil?
33
35
  property name, type, options
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module Devise
3
- VERSION = '1.1.4'.freeze
3
+ VERSION = '1.1.5'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ class DataMapperSchemaTest < ActiveSupport::TestCase
4
+ test 'required explicitly set to false' do
5
+ DataMapper::Property.required(true)
6
+ model = Class.new(User)
7
+ model.apply_devise_schema :required_string, String, :required => true
8
+ model.apply_devise_schema :not_required_string, String
9
+ assert model.properties['required_string'].required?
10
+ assert !model.properties['not_required_string'].required?
11
+ DataMapper::Property.required(false)
12
+ end
13
+ end
@@ -29,13 +29,13 @@ if DEVISE_ORM == :data_mapper
29
29
 
30
30
  class AuthenticationOthersTest < ActionController::IntegrationTest
31
31
 
32
- undef test_registration_in_xml_format_works_when_recognizing_path
32
+ undef test_registration_in_xml_format
33
33
 
34
34
  # DM's validates_confirmation_of requires the confirmation field to be present,
35
35
  # while ActiveModel by default skips the confirmation test if the confirmation
36
36
  # value is nil. This test takes advantage of AM's behavior, so just add the
37
37
  # :password_confirmation value.
38
- test 'registration in xml format works when recognizing path' do
38
+ test 'registration in xml format' do
39
39
  assert_nothing_raised do
40
40
  # post user_registration_path(:format => 'xml', :user => {:email => "test@example.com", :password => "invalid"} )
41
41
  post user_registration_path(:format => 'xml', :user => {:email => "test@example.com", :password => "invalid", :password_confirmation => "invalid"} )
@@ -1,11 +1,10 @@
1
- require 'shared_admin'
2
-
3
1
  class Admin
4
2
  include DataMapper::Resource
5
3
 
6
4
  property :id, Serial
7
5
  property :username, String
8
-
9
- include SharedAdmin
6
+
10
7
  include Shim
8
+
9
+ devise :database_authenticatable, :timeoutable, :registerable, :recoverable, :lockable, :unlock_strategy => :time
11
10
  end
@@ -1,5 +1,3 @@
1
- require 'shared_user'
2
-
3
1
  class User
4
2
  include DataMapper::Resource
5
3
 
@@ -8,7 +6,10 @@ class User
8
6
  property :facebook_token, String
9
7
  timestamps :at
10
8
 
11
- include SharedUser
9
+ devise :database_authenticatable, :confirmable, :lockable, :recoverable,
10
+ :registerable, :rememberable, :timeoutable, :token_authenticatable,
11
+ :trackable, :validatable
12
+
12
13
  include Shim
13
14
 
14
15
  before :valid?, :update_password_confirmation
@@ -1,4 +1,3 @@
1
- require 'shared_admin'
2
1
  require File.join(File.dirname(__FILE__), '../data_mapper/shim.rb')
3
2
 
4
3
  class Admin
@@ -7,6 +6,7 @@ class Admin
7
6
  property :id, Serial
8
7
  property :username, String
9
8
 
10
- include SharedAdmin
11
9
  include Shim
10
+
11
+ devise :database_authenticatable, :timeoutable, :registerable, :recoverable, :lockable, :unlock_strategy => :time
12
12
  end
@@ -1,4 +1,3 @@
1
- require 'shared_user'
2
1
  require File.join(File.dirname(__FILE__), '../data_mapper/shim.rb')
3
2
 
4
3
  class User
@@ -9,6 +8,9 @@ class User
9
8
  property :facebook_token, String
10
9
  timestamps :at
11
10
 
12
- include SharedUser
11
+ devise :database_authenticatable, :confirmable, :lockable, :recoverable,
12
+ :registerable, :rememberable, :timeoutable, :token_authenticatable,
13
+ :trackable, :validatable
14
+
13
15
  include Shim
14
16
  end
data/test/test_helper.rb CHANGED
@@ -16,8 +16,6 @@ Webrat.configure do |config|
16
16
  config.open_error_files = false
17
17
  end
18
18
 
19
- Devise::Oauth.test_mode!
20
-
21
19
  # Add support to load paths so we can overwrite broken webrat setup
22
20
  $:.unshift "#{DEVISE_PATH}/test/support"
23
21
  Dir["#{DEVISE_PATH}/test/support/**/*.rb"].each { |f| require f }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-devise
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 4
10
- version: 1.1.4
9
+ - 5
10
+ version: 1.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jared Morgan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-16 00:00:00 -05:00
18
+ date: 2010-11-12 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -174,6 +174,7 @@ files:
174
174
  - lib/dm-devise/version.rb
175
175
  - lib/generators/data_mapper/devise_generator.rb
176
176
  - test/data_mapper/compatibility_test.rb
177
+ - test/data_mapper/schema_test.rb
177
178
  - test/orm/data_mapper.rb
178
179
  - test/orm/data_mapper_active_model.rb
179
180
  - test/overrides/data_mapper_test.rb
@@ -222,6 +223,7 @@ specification_version: 3
222
223
  summary: Support for using DataMapper ORM with devise
223
224
  test_files:
224
225
  - test/test_helper.rb
226
+ - test/data_mapper/schema_test.rb
225
227
  - test/data_mapper/compatibility_test.rb
226
228
  - test/rails_app/config/environment.rb
227
229
  - test/rails_app/config/application.rb