Add wait_for_ajax to your helper
def wait_for_ajax
Timeout.timeout(Capybara.default_wait_time) do
loop do
active = page.evaluate_script('jQuery.active')
break if active == 0##Ruby (Rails) tips
####1. Array Initialization
if x.is_a?(Array)
x.each { |x| puts x }
else
puts x
endclass DealsController < ApplicationController
before_filter :authenticate_user!, except: [:index, :show, :list]
before_filter :authenticate_proposer, only: [:edit]
rescue_from StandardError, with: :show_errors
rescue_from Order::OrderNotFound, with: :show_errors