From 4d2c52e3f2f51efacb1afa2e3b4ef1a15b0dba9e Mon Sep 17 00:00:00 2001 From: Rimian Perkins Date: Wed, 15 Feb 2017 13:30:28 +1100 Subject: [PATCH] refactor controller name --- .../{choice_controller.rb => payments_controller.rb} | 2 +- config/routes.rb | 4 ++-- ...{choice_controller_spec.rb => payments_controller_spec.rb} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename app/controllers/discourse_payments/{choice_controller.rb => payments_controller.rb} (92%) rename spec/controllers/discourse_payments/{choice_controller_spec.rb => payments_controller_spec.rb} (78%) diff --git a/app/controllers/discourse_payments/choice_controller.rb b/app/controllers/discourse_payments/payments_controller.rb similarity index 92% rename from app/controllers/discourse_payments/choice_controller.rb rename to app/controllers/discourse_payments/payments_controller.rb index 5eafca6..1dfba44 100644 --- a/app/controllers/discourse_payments/choice_controller.rb +++ b/app/controllers/discourse_payments/payments_controller.rb @@ -1,5 +1,5 @@ module DiscoursePayments - class ChoiceController < ApplicationController + class PaymentsController < ApplicationController def index render json: {} end diff --git a/config/routes.rb b/config/routes.rb index 1dc5f3d..f3644e9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ DiscoursePayments::Engine.routes.draw do - resources :choice, only: [:create] - get 'users/:username/payments' => 'choice#show' + resources :payments, only: [:create] + get 'users/:username/payments' => 'payments#show' end diff --git a/spec/controllers/discourse_payments/choice_controller_spec.rb b/spec/controllers/discourse_payments/payments_controller_spec.rb similarity index 78% rename from spec/controllers/discourse_payments/choice_controller_spec.rb rename to spec/controllers/discourse_payments/payments_controller_spec.rb index 59095d9..cfec190 100644 --- a/spec/controllers/discourse_payments/choice_controller_spec.rb +++ b/spec/controllers/discourse_payments/payments_controller_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' module DiscoursePayments - RSpec.describe ChoiceController, type: :controller do + RSpec.describe PaymentsController, type: :controller do routes { DiscoursePayments::Engine.routes } # it 'responds with ok' do