diff --git a/app/controllers/patrons_controller.rb b/app/controllers/patrons_controller.rb index 92e31fb..108458a 100644 --- a/app/controllers/patrons_controller.rb +++ b/app/controllers/patrons_controller.rb @@ -14,6 +14,10 @@ module DiscoursePatrons render json: result end + def show + head 200 + end + def create ::Stripe.api_key = SiteSetting.discourse_patrons_secret_key diff --git a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons.js.es6 index 4332dfa..a642f81 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-discourse-patrons.js.es6 @@ -1,6 +1,5 @@ export default Ember.Controller.extend({ actions: { - loadMore() { - } + loadMore() {} } }); diff --git a/config/routes.rb b/config/routes.rb index 752942d..226e348 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ DiscoursePatrons::Engine.routes.draw do get '/admin' => 'admin#index' get '/' => 'patrons#index' - get '/:pid' => 'patrons#index' + get '/:pid' => 'patrons#show' resources :patrons, only: [:index, :create] end diff --git a/spec/controllers/discourse_patrons/patrons_controller_spec.rb b/spec/controllers/discourse_patrons/patrons_controller_spec.rb index 9469209..3843b51 100644 --- a/spec/controllers/discourse_patrons/patrons_controller_spec.rb +++ b/spec/controllers/discourse_patrons/patrons_controller_spec.rb @@ -27,6 +27,13 @@ module DiscoursePatrons end end + describe 'show' do + it 'responds ok' do + get :show, params: { pid: '123' }, format: :json + expect(response).to have_http_status(200) + end + end + describe 'create' do let(:payment) do {