From 4b01c2aeb938e7249f1ff6770a1909de4cac9c68 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 27 May 2020 10:25:52 -0500 Subject: [PATCH] Update nonprofits/recurring_donations_controller to Rails v6 and jbuilder --- .../nonprofits/recurring_donations_controller.rb | 6 +++++- .../{show.json.jbuilder => show.jbuilder} | 0 spec/controllers/nonprofits/recurring_donations_spec.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) rename app/views/nonprofits/recurring_donations/{show.json.jbuilder => show.jbuilder} (100%) diff --git a/app/controllers/nonprofits/recurring_donations_controller.rb b/app/controllers/nonprofits/recurring_donations_controller.rb index 2623484c..78fed2f4 100644 --- a/app/controllers/nonprofits/recurring_donations_controller.rb +++ b/app/controllers/nonprofits/recurring_donations_controller.rb @@ -56,7 +56,11 @@ module Nonprofits def show @recurring_donation = current_recurring_donation - respond_to { |format| format.json } + respond_to do |format| + format.json do + render locals: {recurring_donation: @recurring_donation} + end + end end def destroy diff --git a/app/views/nonprofits/recurring_donations/show.json.jbuilder b/app/views/nonprofits/recurring_donations/show.jbuilder similarity index 100% rename from app/views/nonprofits/recurring_donations/show.json.jbuilder rename to app/views/nonprofits/recurring_donations/show.jbuilder diff --git a/spec/controllers/nonprofits/recurring_donations_spec.rb b/spec/controllers/nonprofits/recurring_donations_spec.rb index f9300cd3..4a23e1c0 100644 --- a/spec/controllers/nonprofits/recurring_donations_spec.rb +++ b/spec/controllers/nonprofits/recurring_donations_spec.rb @@ -16,7 +16,7 @@ describe Nonprofits::RecurringDonationsController, type: :controller do end describe 'show' do - include_context :open_to_np_associate, :get, :show, nonprofit_id: :__our_np, id: '1', without_json_view: true + include_context :open_to_np_associate, :get, :show, nonprofit_id: :__our_np, id: '1', with_status: 200 end describe 'destroy' do