0
내가 내 사용자를위한 컨트롤러가 레일.422 4.2
RSpec 테스트를 실행할 때 422 오류가 발생합니다.
describe "POST create" do
it "should create a user" do
post :create, user: FactoryGirl.build(:user).attributes, format: :json
expect(response.status).to eq(201)
end
end
- 내가 has_secure_password을 사용하고 내 사용자 모델 : 여기에 실패하는 테스트입니다.
- 내 user_params에서 암호 password_confirmation (강력한 매개 변수)가
- 내 공장 내가 부족 또는 찾아야한다 일치하는 암호 password_confirmation
FactoryGirl.define do factory :user do first_name Faker::Name.first_name last_name Faker::Name.last_name email Faker::Internet.safe_email password "123456789" password_confirmation "123456789" date_of_birth 25.years.ago end end
아무것도있다?