Skip to content

Commit

Permalink
spec, should set initial password following devise password_length
Browse files Browse the repository at this point in the history
  • Loading branch information
satnami authored and scambra committed Mar 7, 2021
1 parent db4b0b3 commit f6a308d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/models/invitable_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require 'test_helper'
require 'model_tests_helper'

class Validatable < User
devise :validatable, password_length: 10..20
end

class InvitableTest < ActiveSupport::TestCase

def setup
Expand Down Expand Up @@ -760,4 +764,10 @@ def assert_callbacks_status(callback, user, fired)
assert user.persisted?
assert user.errors.empty?
end

test 'should set initial password following devise password_length' do
user = Validatable.invite!(email: 'valid@email.com')
user.update_attributes(profile_id: 1)
assert_empty user.errors
end
end

0 comments on commit f6a308d

Please sign in to comment.