diff --git a/README.md b/README.md index 12f8179..487cf6a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/controllers/choice/choice_controller.rb b/app/controllers/choice/choice_controller.rb index 174d625..3a18470 100644 --- a/app/controllers/choice/choice_controller.rb +++ b/app/controllers/choice/choice_controller.rb @@ -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') diff --git a/assets/javascripts/discourse/choice-discourse-route-map.js.es6 b/assets/javascripts/discourse/choice-discourse-route-map.js.es6 new file mode 100644 index 0000000..70ce90a --- /dev/null +++ b/assets/javascripts/discourse/choice-discourse-route-map.js.es6 @@ -0,0 +1,5 @@ +export default function() { + this.route('choice', function() { + this.route('form'); + }); +} diff --git a/assets/javascripts/discourse/routes/choice-discourse-index.js.es6 b/assets/javascripts/discourse/routes/choice-discourse-index.js.es6 new file mode 100644 index 0000000..2f0c6fa --- /dev/null +++ b/assets/javascripts/discourse/routes/choice-discourse-index.js.es6 @@ -0,0 +1,7 @@ +import { ajax } from 'discourse/lib/ajax'; + +export default Ember.Route.extend({ + model() { + return ajax('/choice/form.json'); + } +}); diff --git a/assets/javascripts/discourse/templates/choice/form.hbs b/assets/javascripts/discourse/templates/choice/form.hbs new file mode 100644 index 0000000..25be4e8 --- /dev/null +++ b/assets/javascripts/discourse/templates/choice/form.hbs @@ -0,0 +1 @@ +