refactor module name space

This commit is contained in:
Rimian Perkins 2017-02-15 13:03:58 +11:00
parent 1a20224481
commit 0c6b77b93a
10 changed files with 17 additions and 24 deletions

View File

@ -1,4 +1,4 @@
module Choice
module DiscoursePayments
class ChoiceController < ApplicationController
def index
render json: {}

View File

@ -1,5 +1,5 @@
module Choice
module DiscoursePayments
module ApplicationHelper
end
end

View File

@ -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

View File

View File

@ -1,6 +1,6 @@
require 'choice/engine'
require 'discourse-payments/engine'
byebug
module Choice
module DiscoursePayments
end

View File

@ -1,7 +0,0 @@
module ::Choice
class Engine < ::Rails::Engine
engine_name 'choice'
isolate_namespace Choice
end
end

View File

@ -1,6 +0,0 @@
module ::Choice
class Engine < ::Rails::Engine
engine_name 'choice'
isolate_namespace Choice
end
end

View File

@ -0,0 +1,6 @@
module ::DiscoursePayments
class Engine < ::Rails::Engine
engine_name 'discourse-payments'
isolate_namespace DiscoursePayments
end
end

View File

@ -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

View File

@ -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)