나는 레일 4 응용 프로그램에서 일하고 있어요 그리고 난 브레인 트리에 대한 몇 가지 테스트를 작성하려면시험 브레인은 4
it 'should make new payment info' do
login
visit new_customer_path
page.fill_in 'customer_credit_card_number', :with => '4111111111111111'
page.fill_in 'customer_credit_card_expiration_date', :with => '01/25'
page.fill_in 'customer_credit_card_cvv', :with => '400'
page.click_button 'Save Payment Info'
page.should have_content('Payment Info Confirmation')
page.should have_content('411111******1111')
end
:이 같은 기능 테스트를 실행할 때 해주기 URL
<%= form_for :customer, :url => Braintree::TransparentRedirect.url do |f| %>
:) 레일에 4.0.0
문제는 브레인 트리의 형태로 난을 통과 경로에 함께
는 내가 경로에 오류가 발생합니다 :
Failure/Error: page.click_button 'Save Payment Info'
ActionController::RoutingError:
No route matches [POST] "/merchants/fvn6vfc5ptyg2xrp/transparent_redirect_requests"
나는 또한 컨트롤러 테스트에서 이것을 시도했습니다 (render_views과) :
it 'should make new payment info' do
sign_in_as_user
visit new_customer_path
page.fill_in 'customer_credit_card_number', :with => '4111111111111111'
page.fill_in 'customer_credit_card_expiration_date', :with => '01/25'
page.fill_in 'customer_credit_card_cvv', :with => '400'
page.click_button 'Save Payment Info'
save_and_open_page
page.should have_content('Payment Info Confirmation')
page.should have_content('411111******1111')
end
같은 오류가 경로에 ...
브라우저에서 env가 제대로 작동합니다. 내 양식의 url 옵션이 capybara에 의해 무시됩니다. 아무도 나를 도울 수 있을지 궁금해?
Braintree with Rails의 응용 프로그램 : https://github.com/braintree/braintree_ruby_examples/blob/master/rails3_tr_devise/spec/controllers/customer_controller_spec.rb이 프로젝트에서 테스트를 실행할 때 .. 내 문제는 Rails 및 rspec 버전과 관련이 있습니까?
미리 감사드립니다.
안녕 라이언, 감사에 대한 당신의 대답 : 당신이 정말 브레인 트리의 샌드 박스에 대해 테스트하려는 경우
또는, 당신은 당신의
scenario
같은 태그로 자바 스크립트 드라이버로 전환 할 수 있습니다! 멋진 점은 당신 책 (19 일에 구입 한 책)을 가지고 있지만 요즘에는 책을 들여다 보지 못했다는 것입니다. 테스트를 빨리하기 위해 [링크] https://github.com/thoughtbot/fake_brainree를보고 있었으므로 보석을 사용하겠습니다. 하지만 내가 얻지 못하는 것은 내 컨트롤러 테스트가 braintree 예제와 같이 작동하지 않지만 컨트롤러 테스트가 정확히 동일하다는 것입니다. 추가 : js => 셀렌 드라이버와 사실이 날 이상한 sqlite 오류를 준다 : ( – Daniel셀렌 드라이버와 sqlite 오류에 대해, 나는 그 같은 연결을 사용하여 모든 드라이버를 강제로 수정했습니다 [링크] http : // stackoverflow .com/questions/8774227/why-not-use-shared-activerecord-connections-for-rspec-selenium. 몇 가지 테스트를 위해해야 할 일은 ... – Daniel