@@base_url = 'https://api-de-tarefas.herokuapp.com/users'
@@body =
{
"user": {
"email": Faker::Internet.email,
"password": Faker::Number.number(6),
"password_confirmation":
}
}.to_json
I'm trying to pass in the body the value generated by gem faker in the password field to the password_verification field.
Just determine the value upfront:
@@base_url = 'https://api-de-tarefas.herokuapp.com/users'
password = Faker::Number.number(6)
@@body = {
"user": {
"email": Faker::Internet.email,
"password": password,
"password_confirmation": password
}
}.to_json
Btw do you really need class variables (starting with @@
)? I cannot think of many situations in which a class variable is a good approach.