name space the rails things
This commit is contained in:
parent
7d42f28666
commit
3a428d17f0
|
@ -1,6 +1,6 @@
|
|||
require_dependency 'discourse'
|
||||
|
||||
module DiscoursePayments
|
||||
module DiscourseDonations
|
||||
class ChargesController < ActionController::Base
|
||||
include CurrentUser
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
module DiscoursePayments
|
||||
module DiscourseDonations
|
||||
class PaymentsController < ApplicationController
|
||||
def index
|
||||
render json: {}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
module DiscoursePayments
|
||||
module DiscourseDonations
|
||||
module ApplicationHelper
|
||||
end
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
DiscoursePayments::Engine.routes.draw do
|
||||
DiscourseDonations::Engine.routes.draw do
|
||||
resources :charges, only: [:create]
|
||||
get 'users/:username/payments' => 'payments#show'
|
||||
end
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
module ::DiscourseDonations
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name 'discourse-donations'
|
||||
isolate_namespace DiscourseDonations
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
module ::DiscoursePayments
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name 'discourse-payments'
|
||||
isolate_namespace DiscoursePayments
|
||||
end
|
||||
end
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
gem 'stripe', '2.0.1'
|
||||
|
||||
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
|
||||
load File.expand_path('../lib/discourse_donations/engine.rb', __FILE__)
|
||||
load File.expand_path('../config/stripe.rb', __FILE__)
|
||||
|
||||
after_initialize do
|
||||
|
@ -26,5 +26,5 @@ after_initialize do
|
|||
end
|
||||
|
||||
Discourse::Application.routes.prepend do
|
||||
mount ::DiscoursePayments::Engine, at: '/'
|
||||
mount ::DiscourseDonations::Engine, at: '/'
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
module DiscoursePayments
|
||||
module DiscourseDonations
|
||||
RSpec.describe ChargesController, type: :controller do
|
||||
routes { DiscoursePayments::Engine.routes }
|
||||
routes { DiscourseDonations::Engine.routes }
|
||||
#
|
||||
it 'responds with ok' do
|
||||
skip 'need to get fixtures'
|
|
@ -1,7 +1,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
module DiscoursePayments
|
||||
module DiscourseDonations
|
||||
RSpec.describe PaymentsController, type: :controller do
|
||||
routes { DiscoursePayments::Engine.routes }
|
||||
routes { DiscourseDonations::Engine.routes }
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue