Skip to content

Commit

Permalink
Add missing PasswordForm spec
Browse files Browse the repository at this point in the history
**Why**: To have more complete code coverage
  • Loading branch information
monfresh authored and amoose committed Dec 1, 2016
1 parent c91b5f9 commit 1c45398
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/forms/password_form_spec.rb
Expand Up @@ -6,6 +6,24 @@
it_behaves_like 'password validation'

describe '#submit' do
context 'when the form is valid' do
it 'returns true' do
user = build_stubbed(:user)

form = PasswordForm.new(user)

password = 'valid password'

result = {
success: true,
errors: [],
user_id: user.uuid
}

expect(form.submit(password: password)).to eq result
end
end

context 'when the form is invalid' do
it 'returns false' do
user = build_stubbed(:user, uuid: '123')
Expand Down

0 comments on commit 1c45398

Please sign in to comment.