inital empty page

This commit is contained in:
Rimian Perkins 2017-02-07 13:56:22 +11:00
parent 3e9d32e21d
commit 8d7b50a7ae
8 changed files with 37 additions and 5 deletions

View File

@ -5,3 +5,9 @@ Enables stripe payments from discourse.
# Configuration
You can either set your environment vars in docker or save them in a yaml.
# Testing
Run the local js acceptance tests here:
http://localhost:3000/qunit?module=Acceptance%3A%20Choice%20Discourse

View File

@ -1,5 +1,9 @@
module Choice
class ChoiceController < Choice::ApplicationController
class ChoiceController < ApplicationController
def index
render json: {}
end
def create
badge = Badge.find_by_name('Consumer Defender')

View File

@ -0,0 +1,5 @@
export default function() {
this.route('choice', function() {
this.route('form');
});
}

View File

@ -0,0 +1,7 @@
import { ajax } from 'discourse/lib/ajax';
export default Ember.Route.extend({
model() {
return ajax('/choice/form.json');
}
});

View File

@ -0,0 +1 @@
<h1>Choice</h1>

View File

@ -1,3 +1,4 @@
Choice::Engine.routes.draw do
get 'stripe' => 'choice#create'
get 'form' => 'choice#index'
end

View File

@ -19,8 +19,6 @@ module ::Choice
end
end
after_initialize do
Discourse::Application.routes.prepend do
mount ::Choice::Engine, at: '/choice'
end
Discourse::Application.routes.prepend do
mount ::Choice::Engine, at: '/choice'
end

View File

@ -0,0 +1,10 @@
import { acceptance } from 'helpers/qunit-helpers';
acceptance('Choice Discourse', { loggedIn: true });
test('Choice Page Exists', () => {
visit('/choice/form');
andThen(() => {
ok(exists('h1'), 'Choice');
});
});