From 490c424bc0cb8b60909d9d67fb38bdee57b9af8f Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Thu, 24 Oct 2019 10:39:10 +1100 Subject: [PATCH] only list active plans on the front end --- app/controllers/plans_controller.rb | 2 +- spec/requests/plans_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index e0253be..03dbe1e 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -8,7 +8,7 @@ module DiscoursePatrons def index begin - plans = ::Stripe::Plan.list + plans = ::Stripe::Plan.list(active: true) render_json_dump plans.data diff --git a/spec/requests/plans_controller_spec.rb b/spec/requests/plans_controller_spec.rb index 070a309..93e65e1 100644 --- a/spec/requests/plans_controller_spec.rb +++ b/spec/requests/plans_controller_spec.rb @@ -5,8 +5,8 @@ require 'rails_helper' module DiscoursePatrons RSpec.describe PlansController do describe "index" do - it "lists the plans" do - ::Stripe::Plan.expects(:list) + it "lists the active plans" do + ::Stripe::Plan.expects(:list).with(active: true) get "/patrons/plans.json" end end