Conversation
ghost
left a comment
There was a problem hiding this comment.
Review the suggestion below
One doubt i have is that currently there is not much feature for signup to write tests. Hence can we rename the signup directory to auth and place this file inside it as auth/signup.spec.rb. Later we will add more signin test in it.
Other looks good to me.
| visit new_user_registration_path | ||
| expect(page).to have_content('Sign up new account') | ||
|
|
||
| fill_in('user_full_name', with: 'John Doe') | ||
| select "ASHA", :from => "user_role" |
There was a problem hiding this comment.
These lines are repeating in every test iteration. Can we use before(:each) here
There was a problem hiding this comment.
Okay. Will do that.
| expect(page).to have_content('Your account is not verified!') | ||
| end | ||
|
|
There was a problem hiding this comment.
Indentation seems too much.
Does prettier support ruby file 🤔
Otherwise we have to install rufo extension 😅
There was a problem hiding this comment.
Prettier now supports Ruby formatting as well. Is your prettier working @divyagar ?
| fill_in('user_email', with: 'johndoe@example.com') | ||
| fill_in('user_phone', with: '9988776677') | ||
| fill_in('user_password', with: 'JohnDoe') |
There was a problem hiding this comment.
We can fill these info using Faker for generating names, emails etc. Its like chance.js and we can avoid these hardcoded data.
Faker creates different names, emails etc i think. everytime it runs
There was a problem hiding this comment.
Okay. Will use that.
There was a problem hiding this comment.
@abhinandanarya06 We also need to store the names and password as well as we need the same for Login as well
There was a problem hiding this comment.
Then I think we have create user command in factorybot. We can use it in Login testing.
Or we can use rspec fixtures if we need to store and reuse in different tests.
I have added integration tests for signup feature.
https://www.loom.com/share/77893a2edfa645c9b64f74c6fa552cb2