fix routes. get specs passing
This commit is contained in:
parent
3f90518e18
commit
2e3cdb0dcf
|
@ -1,4 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module DiscoursePatrons
|
||||
class PatronsController < ApplicationController
|
||||
def index
|
||||
result = {}
|
||||
render json: result
|
||||
end
|
||||
|
||||
def create
|
||||
render json: {}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Discourse::Application.routes.append do
|
||||
get '/patrons' => 'patrons#index'
|
||||
get '/patrons/:pid' => 'patrons#index'
|
||||
DiscoursePatrons::Engine.routes.draw do
|
||||
get '/' => 'patrons#index'
|
||||
get '/:pid' => 'patrons#index'
|
||||
|
||||
resources :patrons, only: [:index, :create]
|
||||
end
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# name: Discourse Patrons
|
||||
# about: Integrates Stripe into Discourse to allow visitors to make donations
|
||||
# version: 1.0.0
|
||||
# url: https://github.com/rimian/discourse-patron
|
||||
# authors: Rimian Perkins
|
||||
|
||||
enabled_site_setting :discourse_patrons_enabled
|
||||
|
||||
|
|
|
@ -6,10 +6,16 @@ module DiscoursePatrons
|
|||
RSpec.describe PatronsController, type: :controller do
|
||||
routes { DiscoursePatrons::Engine.routes }
|
||||
|
||||
it 'responds ok for anonymous users' do
|
||||
post :create, params: {}, format: :json
|
||||
describe 'index' do
|
||||
it 'responds ok' do
|
||||
get :index, format: :json
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
|
||||
aggregate_failures do
|
||||
describe 'create' do
|
||||
it 'responds ok' do
|
||||
post :create, params: { }, format: :json
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue