mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
All tests green on latest mongoid.
This commit is contained in:
parent
f96061b350
commit
dd11f43014
7 changed files with 32 additions and 28 deletions
6
Gemfile
6
Gemfile
|
@ -12,9 +12,9 @@ platforms :ruby do
|
|||
gem "ruby-debug", ">= 0.10.3"
|
||||
end
|
||||
group :mongoid do
|
||||
gem "mongo"
|
||||
gem "mongoid", :git => "git://github.com/mongoid/mongoid.git"
|
||||
gem "bson_ext"
|
||||
gem "mongo", "1.0.7"
|
||||
gem "mongoid", "2.0.0.beta.18"
|
||||
gem "bson_ext", "1.0.7"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
35
Gemfile.lock
35
Gemfile.lock
|
@ -1,14 +1,3 @@
|
|||
GIT
|
||||
remote: git://github.com/mongoid/mongoid.git
|
||||
revision: f38e3ef
|
||||
specs:
|
||||
mongoid (2.0.0.beta.16)
|
||||
activemodel (~> 3.0.0)
|
||||
bson (= 1.0.4)
|
||||
mongo (= 1.0.7)
|
||||
tzinfo (~> 0.3.22)
|
||||
will_paginate (~> 3.0.pre)
|
||||
|
||||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
|
@ -43,12 +32,12 @@ GEM
|
|||
activemodel (= 3.0.0)
|
||||
activesupport (= 3.0.0)
|
||||
activesupport (3.0.0)
|
||||
addressable (2.2.0)
|
||||
addressable (2.2.1)
|
||||
arel (1.0.1)
|
||||
activesupport (~> 3.0.0)
|
||||
bcrypt-ruby (2.1.2)
|
||||
bson (1.0.4)
|
||||
bson_ext (1.0.4)
|
||||
bson_ext (1.0.7)
|
||||
builder (2.1.2)
|
||||
columnize (0.3.1)
|
||||
erubis (2.6.6)
|
||||
|
@ -59,7 +48,7 @@ GEM
|
|||
i18n (0.4.1)
|
||||
jdbc-sqlite3 (3.6.3.054)
|
||||
linecache (0.43)
|
||||
mail (2.2.5)
|
||||
mail (2.2.6.1)
|
||||
activesupport (>= 2.3.6)
|
||||
mime-types
|
||||
treetop (>= 1.4.5)
|
||||
|
@ -68,6 +57,12 @@ GEM
|
|||
rake
|
||||
mongo (1.0.7)
|
||||
bson (>= 1.0.4)
|
||||
mongoid (2.0.0.beta.18)
|
||||
activemodel (~> 3.0.0)
|
||||
bson (= 1.0.4)
|
||||
mongo (= 1.0.7)
|
||||
tzinfo (~> 0.3.22)
|
||||
will_paginate (~> 3.0.pre)
|
||||
multi_json (0.0.4)
|
||||
nokogiri (1.4.3.1)
|
||||
nokogiri (1.4.3.1-java)
|
||||
|
@ -77,9 +72,9 @@ GEM
|
|||
multi_json (>= 0.0.4)
|
||||
polyglot (0.3.1)
|
||||
rack (1.2.1)
|
||||
rack-mount (0.6.12)
|
||||
rack-mount (0.6.13)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (0.5.4)
|
||||
rack-test (0.5.5)
|
||||
rack (>= 1.0)
|
||||
rails (3.0.0)
|
||||
actionmailer (= 3.0.0)
|
||||
|
@ -101,7 +96,7 @@ GEM
|
|||
ruby-debug-base (0.10.3)
|
||||
linecache (>= 0.3)
|
||||
sqlite3-ruby (1.3.1)
|
||||
thor (0.14.0)
|
||||
thor (0.14.1)
|
||||
treetop (1.4.8)
|
||||
polyglot (>= 0.3.1)
|
||||
tzinfo (0.3.23)
|
||||
|
@ -121,10 +116,10 @@ PLATFORMS
|
|||
DEPENDENCIES
|
||||
activerecord-jdbcsqlite3-adapter
|
||||
bcrypt-ruby
|
||||
bson_ext
|
||||
bson_ext (= 1.0.7)
|
||||
mocha
|
||||
mongo
|
||||
mongoid!
|
||||
mongo (= 1.0.7)
|
||||
mongoid (= 2.0.0.beta.18)
|
||||
oauth2
|
||||
rails (= 3.0.0)
|
||||
ruby-debug (>= 0.10.3)
|
||||
|
|
|
@ -116,10 +116,11 @@ module Devise
|
|||
|
||||
unless record
|
||||
record = new
|
||||
record.send(:attributes=, attributes, false)
|
||||
|
||||
required_attributes.each do |key|
|
||||
record.errors.add(key, attributes[key].present? ? error : :blank)
|
||||
value = attributes[key]
|
||||
record.send("#{key}=", value)
|
||||
record.errors.add(key, value.present? ? error : :blank)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -103,7 +103,8 @@ class OAuthableIntegrationTest < ActionController::IntegrationTest
|
|||
|
||||
# Create an user and change his e-mail
|
||||
user = sign_in_as_user
|
||||
user.update_attribute(:email, "another@test.com")
|
||||
user.email = "another@test.com"
|
||||
user.save!
|
||||
|
||||
assert_no_difference "User.count" do
|
||||
visit "/"
|
||||
|
|
|
@ -66,7 +66,7 @@ class RegistrationTest < ActionController::IntegrationTest
|
|||
click_button 'Sign up'
|
||||
|
||||
assert_current_url '/users'
|
||||
assert_contain(/Email .* already .* taken/)
|
||||
assert_contain(/Email.*already.*taken/)
|
||||
|
||||
assert_not warden.authenticated?(:user)
|
||||
end
|
||||
|
|
|
@ -11,8 +11,12 @@ module Shim
|
|||
options.delete(:order) if options[:order] == "id"
|
||||
super(options)
|
||||
end
|
||||
|
||||
def find_by_email(email)
|
||||
first(:conditions => { :email => email })
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# overwrite equality (because some devise tests use this for asserting model equality)
|
||||
def ==(other)
|
||||
other.is_a?(self.class) && _id == other._id
|
||||
|
|
|
@ -4,4 +4,7 @@ class User
|
|||
include Mongoid::Document
|
||||
include Shim
|
||||
include SharedUser
|
||||
|
||||
field :username, :type => String
|
||||
field :facebook_token, :type => String
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue