Adding another field to an Httparty field

Asked

Viewed 63 times

0

For example in the "password_confirm" field I want to add the "password field".

@@base_url  = 'https://api-de-tarefas.herokuapp.com/users'
    @@body = 
    {
    "user": {
    "email": Faker::Internet.email,
    "password":  Faker::Number(6),
    "password_confirmation": 

     }    
}.to_json

1 answer

0


I don’t know if I understand it very well, but I think just throw the password in a variable:

password = Faker::Number(6)

@@base_url  = 'https://api-de-tarefas.herokuapp.com/users'


    @@body = 
    {
    "user": {
    "email": Faker::Internet.email,
    "password":  password,
    "password_confirmation": password

     }    
}.to_json

Browser other questions tagged

You are not signed in. Login or sign up in order to post.