Fixing requests tests.
This commit is contained in:
parent
4426bc1844
commit
5ab1856291
2 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ class User < ActiveRecord::Base
|
||||||
before_validation :generate_password, :on => :create
|
before_validation :generate_password, :on => :create
|
||||||
|
|
||||||
def generate_password
|
def generate_password
|
||||||
if self.force_random_password == true
|
if self.force_random_password
|
||||||
self.password = self.password_confirmation = Devise.friendly_token.first(8)
|
self.password = self.password_confirmation = Devise.friendly_token.first(8)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
-if f.object.new_record?
|
-if f.object.new_record?
|
||||||
.clearfix
|
.clearfix
|
||||||
= f.label :admin, :class => "checkbox" do
|
= f.label :admin, :class => "checkbox" do
|
||||||
= f.check_box :force_random_password
|
= f.check_box :force_random_password, {}, true, nil
|
||||||
%span Generate random password
|
%span Generate random password
|
||||||
|
|
||||||
%div.password-fields
|
%div.password-fields
|
||||||
|
|
Loading…
Add table
Reference in a new issue