Commit 5ab1856291d845b27f68c41f23ca76c78afcbce1

Authored by Jakub Troszok
1 parent 4426bc18

Fixing requests tests.

app/models/user.rb
@@ -59,7 +59,7 @@ class User < ActiveRecord::Base @@ -59,7 +59,7 @@ class User < ActiveRecord::Base
59 before_validation :generate_password, :on => :create 59 before_validation :generate_password, :on => :create
60 60
61 def generate_password 61 def generate_password
62 - if self.force_random_password == true 62 + if self.force_random_password
63 self.password = self.password_confirmation = Devise.friendly_token.first(8) 63 self.password = self.password_confirmation = Devise.friendly_token.first(8)
64 end 64 end
65 end 65 end
app/views/admin/users/_form.html.haml
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 -if f.object.new_record? 23 -if f.object.new_record?
24 .clearfix 24 .clearfix
25 = f.label :admin, :class => "checkbox" do 25 = f.label :admin, :class => "checkbox" do
26 - = f.check_box :force_random_password 26 + = f.check_box :force_random_password, {}, true, nil
27 %span Generate random password 27 %span Generate random password
28 28
29 %div.password-fields 29 %div.password-fields