저는 RoR을 처음 사용하고 테스트 중심 개발을 발견하기 전에 몇 가지 사항을 프로그래밍했습니다. 그래서 guard-rspec과 capybara로 몇 가지 테스트를 작성하려고했습니다. 모두 좋았지 만 devise (deprecation warnings for version 1.1.rc02)가있어 최신 버전 (1.4.5)으로 업데이트했습니다. 업데이트 후 작동하지 않는 Devise capybara를 통한 테스트 완료
DEPRECATION WARNING: Using form_for(:name, @resource) is deprecated. Please use form_for(@resource, :as => :name) instead. (called from _app_views_devise_sessions_new_html_erb___942904761_2291541620_0 at /Users/xonic/Documents/work/ror.ror.at/app/views/devise/sessions/new.html.erb:3)
FDEPRECATION WARNING: Using form_for(:name, @resource) is deprecated. Please use form_for(@resource, :as => :name) instead. (called from _app_views_devise_sessions_new_html_erb___942904761_2291541620_0 at /Users/xonic/Documents/work/ror.ror.at/app/views/devise/sessions/new.html.erb:3)
.DEPRECATION WARNING: Using form_for(:name, @resource) is deprecated. Please use form_for(@resource, :as => :name) instead. (called from _app_views_devise_registrations_new_html_erb__1735759005_2291086140_0 at /Users/xonic/Documents/work/ror.ror.at/app/views/devise/registrations/new.html.erb:3)
그래서 내가
<%= form_for(resource, :url => registration_path(resource_name)) do |f| %>
에
<%= form_for(resource_name, resource, :url => registration_path(resource_name)) do |f| %>
를 변경하는 모든 사양을 실행
및 경고 제거있어 :
이
은 경고했다. 지금까지는 너무 좋았습니다. 테스트를 계속했고 브라우저에서 직접 응용 프로그램을 열려고 시도하지 않았습니다.은 그때 무슨 일이 있었는지 모르겠지만 모든 브라우저에서 응용 프로그램을 실행하려고 할 때, 나는 다음과 같은 오류 메시지가 얻을 갑자기 : 그래서 분명히
NoMethodError in Slides#index
Showing /Users/xonic/Documents/work/ror.ror.at/app/views/layouts/application.html.erb where line #27 raised:
private method `split' called for #<Class:0x10c023278>
Extracted source (around line #27):
24:
25: <div class="gopro">
26:
27: <% if user_signed_in? %>
28: Signed in as <%= link_to current_user.username, user_path(current_user) %>. Not you? <%#, user_slides_path(current_user.username) %>
29: <%= link_to "Sign out", destroy_user_session_path %>
30: <% else %>
을 고안 문제입니다. .. 왜 그런지 모르겠다. 재미있는 점은 응용 프로그램을 테스트하는 동안 save_and_open_page
을 호출하면 브라우저 창이 열리고 응용 프로그램이 올바르게 표시되고 오류가 전혀 표시되지 않습니다.
Guard::RSpec is running, with RSpec 2!
Running all specs
...
Finished in 0.95467 seconds
3 examples, 0 failures
UPDATE :이 매우 비슷한 질문 Devise: NoMethod Error & user_signed_in을 본 적이하고는 문제가되지 않습니다, 그래서 제대로, 사용자 모델을 설정 한 .
이 나에게 매우 혼란은, 희망 누군가가 거기 crossingFingers
감사합니다, xon1c을 무슨 일이 일어나고 있는지 이해
UPDATE 내가 그것을 고정하지만, 나에게 대답 유래 못하게 내 평판이 부족하여 다음 6 시간 만에 자신의 질문 한숨. 나중에 솔루션을 게시합니다.
서버를 테스트 모드 ('rails server -e testing')로 실행하면 브라우저에서 페이지가 올바르게 열립니 까? – David
제 잘못,'레일즈 서버 -e 테스트'가 필요합니다. 사과 – David
테스트 데이터베이스와 함께 서버를 실행하고 페이지를 열면 다음과 같은 오류가 발생합니다. 내부 서버 오류 # 전용 메소드'split '이 (가) 호출 됨 WEBrick/1.3.1 (Ruby/1.8. 7/2010-01-10) at localhost : 3000 –
xon1c