Skip to content

Navigation Menu

Sign up

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

Shouichi Kamiya edited this page Oct 23, 2019 · 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

AltStyle によって変換されたページ (->オリジナル) /