Closed jmax closed 11 years ago
Tip:
https://github.com/jmax/nch https://github.com/jmax/nch/blob/master/app/models/user.rb https://github.com/jmax/nch/blob/master/app/models/company.rb https://github.com/jmax/nch/blob/master/app/views/devise/registrations/new.html.erb https://github.com/jmax/nch/blob/master/spec/models/user_spec.rb
As a visitor I visit /users/sign_up
when I fill in "user[first_name]" with "Bruce" and I fill in "user[last_name]" with "Banner" and I fill in "user[email]" with "bruce@thehulk.com" and I fill in "user[company_attributes][name]" with "The Hulk!" and I fill in "user[password]" with "123123123" and I fill in "user[password_confirmation]" with "123123123" and I click "Sign up"
Then a user is created and a company is created with the name "The Hulk!" and the user is linked to that company