Hello everyone!
I'm trying to write specs for login/signup procedure.
I've inspected the code and came out with these potential scenarios.
Can someone help me to correct, validate, refine these scenarios to met the reality?
(I follow the format ---> )
1 User never login before
create new user
create new identity
update user data
create session
go to welcome page
2 User second login with same provider
find existing user
find existing identity
update user data
create session
go to dashboard
3 User second login with other provider
find existing user
create new identity
update user data
create session
go to dashboard
4 User revoked authorization on twitter, login and re-authorizes
find existing user
find existing identity
update user data
create session
go to dashboard
Error cases ——
5 Twitter doesn’t provide enough information for the user (let’s say uid is nil)
don't create session
go to back to same page
display error message Twitter authorization problem. Try again later
Yep, that sounds right. We have a feature test for Twitter auth /spec/features/user_logs_in_with_twitter_spec.rb and some other tests for registration in spec/models/user_spec.rb#270. Those should be helpful for see what else would need coverage.
Hello everyone!
I'm trying to write specs for login/signup procedure.
I've inspected the code and came out with these potential scenarios.
Can someone help me to correct, validate, refine these scenarios to met the reality?
(I follow the format ---> )
1 User never login before
create new user
create new identity
update user data
create session
go to welcome page
2 User second login with same provider
find existing user
find existing identity
update user data
create session
go to dashboard
3 User second login with other provider
find existing user
create new identity
update user data
create session
go to dashboard
4 User revoked authorization on twitter, login and re-authorizes
find existing user
find existing identity
update user data
create session
go to dashboard
Error cases ——
5 Twitter doesn’t provide enough information for the user (let’s say uid is nil)
don't create session
go to back to same page
display error message
Twitter authorization problem. Try again later
@ben ^ ?
That seems like the right path. @andy can provide more thoughts
Yep, that sounds right. We have a feature test for Twitter auth
/spec/features/user_logs_in_with_twitter_spec.rb
and some other tests for registration inspec/models/user_spec.rb#270
. Those should be helpful for see what else would need coverage.Awesome thanks I'll take a look.