0
私はアクションでcheckouts_controller.rb
を持っている:コントローラのヘルパーステートメントをテストするには?
def create
if create_customer(params[:stripeToken], @plan.my_plan_id, params[:code], params[:new_price])
redirect_to user_path(id: current_user.to_param, customer_share: true)
else
redirect_to new_checkout_path(plan_id: @plan)
end
end
users_helper.rb
で:
def create_customer
if customer != nil
...
else
flash[:error] = 'Something went wrong, please try again.'
end
は、だから私は他にチェックし、
flash[:error]
ためにRSpecの中でそれをテストする必要があります。
火災ストライプ:: InvalidRequestError –
どうやらあなたは 'ストライプruby'宝石を使用しています。ストライプ関連のすべての要件を満たす必要があります。 – Uzbekjon