describe "plans/payment/:id" do let!(:stripe_customer_user) { "id": "cus_N0gSGJmClHShuw", "invoice_settings": { "default_payment_method": "pm_dsqbhjdbqi" } } example "ページは表示されるか" do allow(Stripe::Customer).to receive(:retrieve).and_return(stripe_customer_user) get "/plans/payment/#{plan_of_user01.id}" expect(response.status).to eq(200) end end
viewで@stripe_customer_user.invoice_settings.default_payment_methodを引っ張っており、default_payment_methodを上記で定義しているのですが、下記のエラーが出てしまいます
NoMethodError: undefined method `invoice_settings' for #<Hash:0x0000aaaaca3eb3c0>
実現したいこと
@stripe_customer_user.invoice_settings.default_payment_methodに値を入れ、ページを表示させたい
発生している問題・エラーメッセージ
NoMethodError: undefined method `invoice_settings' for #<Hash:0x0000aaaaca3eb3c0>
引っ張る??
テストだけではなく実装コードもないと分からない気がします

回答1件
あなたの回答
tips
プレビュー