refactor module name space
This commit is contained in:
parent
1a20224481
commit
0c6b77b93a
|
@ -1,4 +1,4 @@
|
|||
module Choice
|
||||
module DiscoursePayments
|
||||
class ChoiceController < ApplicationController
|
||||
def index
|
||||
render json: {}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
module Choice
|
||||
module DiscoursePayments
|
||||
module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Choice::Engine.routes.draw do
|
||||
DiscoursePayments::Engine.routes.draw do
|
||||
resources :choice, only: [:create]
|
||||
get 'users/:username/payments' => 'choice#show'
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'choice/engine'
|
||||
require 'discourse-payments/engine'
|
||||
|
||||
byebug
|
||||
|
||||
module Choice
|
||||
module DiscoursePayments
|
||||
end
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
module ::Choice
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name 'choice'
|
||||
isolate_namespace Choice
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
module ::Choice
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name 'choice'
|
||||
isolate_namespace Choice
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
module ::DiscoursePayments
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name 'discourse-payments'
|
||||
isolate_namespace DiscoursePayments
|
||||
end
|
||||
end
|
|
@ -1,12 +1,12 @@
|
|||
# name: discourse-payments
|
||||
# about: Integrating Discourse with Stripe
|
||||
# version: 1.0.1
|
||||
# version: 1.1.0
|
||||
# url: https://github.com/choiceaustralia/discourse-payments
|
||||
|
||||
gem 'stripe', '1.58.0'
|
||||
|
||||
load File.expand_path('../lib/discourse-payments/engine.rb', __FILE__)
|
||||
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
|
||||
|
||||
Discourse::Application.routes.prepend do
|
||||
mount ::Choice::Engine, at: '/'
|
||||
mount ::DiscoursePayments::Engine, at: '/'
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require 'rails_helper'
|
||||
|
||||
module Choice
|
||||
module DiscoursePayments
|
||||
RSpec.describe ChoiceController, type: :controller do
|
||||
routes { Choice::Engine.routes }
|
||||
|
||||
routes { DiscoursePayments::Engine.routes }
|
||||
#
|
||||
it 'responds with ok' do
|
||||
post :create
|
||||
expect(response).to have_http_status(200)
|
Loading…
Reference in New Issue