문제

현재 9.13에서 9.2 사이에 갇혀 있습니다.Spec 및 Controller 파일을 해당 섹션과 정확하게 복사했지만 여전히 RSPEC 테스트를 통과하는 데 어려움을 겪고 있습니다.이 오류를 얻는 것은 일반적입니까?나는 여기에 게시 된 것을 발견하지 못했습니다.

Failures:

1) User_pages edit with valid information Failure/Error: it { should have_title(new_name) } expected #has_title?("New Name") to return true, got false # ./spec/requests/user_pages_spec.rb:47:in `block (4 levels) in '

2) User_pages edit with valid information Failure/Error: it { should have_selector('div.alert.alert-success') } expected #has_selector?("div.alert.alert-success") to return true, got false # ./spec/requests/user_pages_spec.rb:48:in `block (4 levels) in '

3) User_pages edit with valid information Failure/Error: specify { expect(user.reload.name).to eq new_name }

   expected: "New Name"
        got: "John Smith"

   (compared using ==)
 # ./spec/requests/user_pages_spec.rb:50:in `block (4 levels) in <top (required)>'
4) User_pages edit with valid information Failure/Error: specify { expect(user.reload.email).to eq new_email }

   expected: "new@example.com"
        got: "champion@aol.com"

   (compared using ==)
 # ./spec/requests/user_pages_spec.rb:51:in `block (4 levels) in <top (required)>'
Finished in 4.41 seconds 64 examples, 4 failures

Failed examples:

rspec ./spec/requests/user_pages_spec.rb:47 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:48 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:50 # User_pages edit with valid information rspec ./spec/requests/user_pages_spec.rb:51 # User_pages edit with valid information
.

나는 여기에 몇 가지 코드를 게시했습니다 : https://gist.github.com/ephunit/8293106

다른 파일을보고 싶은지 알려주세요.

PS 모든 사양 테스트는 9.13 이전에 녹색이었습니다.어떤 도움도 감사합니다.

편집 : 흥미로운 ... 웹 페이지에서 런을 할 때 WebApp에서 설정을 클릭하여 프로필을 업데이트하고 새 암호를 저장하려고하면 다음 오류가 발생합니다. 양식에는 1 오류가 있습니다. * 비밀번호 확인은 비워 둘 수 없습니다

새 암호를 입력하려고했지만.단순히 원래 암호를 넣으면 동일한 오류가 발생합니다.이것은 내가 실패한 이유 일 수 있습니다.

도움이 되었습니까?

해결책

spec_error

 1) User_pages edit with valid information Failure/Error: it { should have_title(new_name) } expected #has_title?("New Name") to return true, got false # ./spec/requests/user_pages_spec.rb:47:in `block (4 levels) in '
.

이 문제는 일반적으로 {title : sign-up} view / static-pages 의 맨 위에있는 코드를 넣지 않을 때 발생합니다 (예 : 제목 : 정보 페이지에 대해 ).나는 정확한 코드를 모른다. 그러나 나는 동일한 문제를 해결 하고이 솔루션으로 해결되었다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top