makes sure no blank redeemable codes are db stored
This commit is contained in:
@@ -24,4 +24,24 @@ feature 'Registration form' do
|
||||
expect(page).to have_content I18n.t("devise_views.users.registrations.new.username_is_available")
|
||||
end
|
||||
|
||||
scenario 'do not save blank redeemable codes' do
|
||||
visit new_user_registration_path(use_redeemable_code: 'true')
|
||||
|
||||
fill_in 'user_username', with: "NewUserWithCode77"
|
||||
fill_in 'user_email', with: "new@madrid.es"
|
||||
fill_in 'user_password', with: "password"
|
||||
fill_in 'user_password_confirmation', with: "password"
|
||||
fill_in 'user_redeemable_code', with: " "
|
||||
fill_in 'user_captcha', with: correct_captcha_text
|
||||
check 'user_terms_of_service'
|
||||
|
||||
click_button 'Register'
|
||||
|
||||
expect(page).to have_content "Thank you for registering"
|
||||
|
||||
new_user = User.last
|
||||
expect(new_user.username).to eq("NewUserWithCode77")
|
||||
expect(new_user.redeemable_code).to be_nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user