controller spec runs
This commit is contained in:
parent
109d6fc137
commit
3f90518e18
|
@ -0,0 +1,8 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module ::DiscoursePatrons
|
||||||
|
class Engine < ::Rails::Engine
|
||||||
|
engine_name 'discourse-patrons'
|
||||||
|
isolate_namespace DiscoursePatrons
|
||||||
|
end
|
||||||
|
end
|
|
@ -4,6 +4,11 @@
|
||||||
enabled_site_setting :discourse_patrons_enabled
|
enabled_site_setting :discourse_patrons_enabled
|
||||||
|
|
||||||
after_initialize do
|
after_initialize do
|
||||||
|
load File.expand_path('../lib/discourse_patrons/engine.rb', __FILE__)
|
||||||
load File.expand_path('../config/routes.rb', __FILE__)
|
load File.expand_path('../config/routes.rb', __FILE__)
|
||||||
load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__)
|
load File.expand_path('../app/controllers/patrons_controller.rb', __FILE__)
|
||||||
|
|
||||||
|
Discourse::Application.routes.append do
|
||||||
|
mount ::DiscoursePatrons::Engine, at: 'patrons'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,5 +5,13 @@ require 'rails_helper'
|
||||||
module DiscoursePatrons
|
module DiscoursePatrons
|
||||||
RSpec.describe PatronsController, type: :controller do
|
RSpec.describe PatronsController, type: :controller do
|
||||||
routes { DiscoursePatrons::Engine.routes }
|
routes { DiscoursePatrons::Engine.routes }
|
||||||
|
|
||||||
|
it 'responds ok for anonymous users' do
|
||||||
|
post :create, params: {}, format: :json
|
||||||
|
|
||||||
|
aggregate_failures do
|
||||||
|
expect(response).to have_http_status(200)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue