我使用MINITEST,水豚和騷靈,這是simple_form測試:水豚和click_on方法+ simple_form [JavaScript錯誤]
<%= simple_form_for :search, url: ads_path , wrapper: :inline_form, html: {class: 'form-inline'}, :method => :get do |f| %>
<%= f.error_notification %>
<%= f.input :type_id, collection: @types, label_html: {class: 'form_home'}, selected: 'house'%>
<%= f.input :city, label: 'Where?', placeholder: 'What is the city ?'%>
<br>
<br>
<%= f.submit "Search", :class => "btn btn-primary btn-xl page-scroll" %>
<% end %>
的問題,當我添加click_on「搜索」依賴
test "search correctly" do
visit "/"
select "house", :from => "search_type_id"
fill_in 'search_city' , with: ""
click_on 'Search'
end
在終端上的javascrip錯誤:
Capybara::Poltergeist::JavascriptError:
Capybara::Poltergeist::JavascriptError: One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).Error: Bounds are not valid. Error: Bounds are not valid. at http://127.0.0.1:43411/assets/application-1442915127e4fa1072f69aa9aa4d07ce85cdc5115df9b3a40da528ee05ebfe94.js:43537 at http://127.0.0.1:43411/ads?utf8=%E2%9C%93&search%5Btype_id%5D=1&search%5Bcity%5D=&commit=Search:135 test/integration/home_test.rb:16:in `block in <class:HomeTest>'
還有其他的選擇嗎?
謝謝你的回答,併爲延誤抱歉。我嘗試了你的悲傷,無法解決這個問題,但我決定去Rspec,而不是其他原因!現在我進行得很順利;) –