나는 한 데모 애플리케이션이 발견 :누군가 RSpec으로 best_in_place 테스트 헬퍼 메소드를 테스트 한 적이 있습니까?
it "should be able to use bip_text to update a text field" do
@user.save!
visit user_path(@user)
within("#email") do
page.should have_content("[email protected]")
end
bip_text @user, :email, "[email protected]"
visit user_path(@user)
within("#email") do
page.should have_content("[email protected]")
end
end
https://github.com/dougc84/best_in_place/blob/master/spec/integration/js_spec.rb
쉽게 보인다. 그것은 너무 빨리 나는 거의 아무 것도 볼 수 있어요
before (:each) do
@report = FactoryGirl.create(:report)
visit report_path(@report)
end
it "name", :focus do
within("#name") do
page.should have_content @report.name
end
bip_text @report, :name, "new name"
visit report_path(@report)
within("#name") do
page.should have_content "new name"
end
end
하지만 # NAME 필드 뭔가를 않는 것 같습니다 :
그래서 난 내 카피 바라 사양에 복사됩니다. 그러면 페이지가 다시로드되고 여전히 오래된 값입니다.어떤 도움이 필요합니까?
오 btw 브라우저에서 작동합니다. 테스트를 통과 할 수 없습니다.