Skip to content

Commit

Permalink
add initial signup specs
Browse files Browse the repository at this point in the history
  • Loading branch information
christinalcole committed Aug 25, 2017
1 parent 88fa9a2 commit c6603cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/features/users/signin_and_signup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@

RSpec.feature 'Sign up', :devise do
scenario 'a user cannot sign up if already registerd'
scenario 'a user can sign up with valid credentials'
scenario 'a user can sign up with valid credentials' do
user = FactoryGirl.build(:user)
signup(user.email, user.password)
expect(page).to have_content I18n.t 'devise.registrations.signed_up'
end
scenario 'a user cannot sign up without an email'
scenario 'a user cannot sign up without a unique email'
scenario 'a user cannot sign up without a valid password'
Expand Down
8 changes: 8 additions & 0 deletions spec/support/helpers/session_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ def signin(email, password)
fill_in 'Password', with: password
click_button 'Log in'
end

def signup(email, password)
visit new_user_registration_path
fill_in 'Email', with: email
fill_in 'Password', with: password
fill_in 'Password confirmation', with: password
click_button 'Sign up'
end
end
end

0 comments on commit c6603cc

Please sign in to comment.