Skip to content

How To: request or feature test with Rails 3 (and rspec) for signup

tgaff edited this page Aug 25, 2015 · 2 revisions
### Test for creating an account

require 'spec_helper'

describe "Spec for Sign Up" do     
     it "should create new user account" do     
	visit new_user_registration_path    
	email = "abcd@example.com"    
	fill_in 'user_email', :with => email    
	fill_in 'user_password', :with => "password"    
	fill_in 'user_password_confirmation', :with => "password"    
	click_button 'Sign up'    
	expect(page).to have_content "Welcome! You have signed up successfully."    
    end    
end
Clone this wiki locally