Merge pull request #629 from AyuntamientoMadrid/letter-verification-fix

fixes an issue where users which requested a letter did not get the verification code set up
This commit is contained in:
Enrique García
2015-10-21 12:18:09 +02:00
2 changed files with 10 additions and 4 deletions

View File

@@ -3,11 +3,12 @@ class Verification::Letter
attr_accessor :user, :verification_code, :email, :password, :verify
validates :email, presence: true
validates :password, presence: true
validates :verification_code, presence: true
validate :validate_existing_user
validates :email, presence: true, if: :verify?
validates :password, presence: true, if: :verify?
validates :verification_code, presence: true, if: :verify?
validate :validate_correct_code, if: :verify?
def save

View File

@@ -12,6 +12,11 @@ feature 'Verify Letter' do
click_link "Request a letter"
expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account."
user.reload
expect(user.letter_requested_at).to be
expect(user.letter_verification_code).to be
end
scenario 'Go to office instead of send letter' do