Commit c1d3ce94 authored by Justin Ho's avatar Justin Ho

Fix spec name and refactor controller code

We can include IntegrationsHelper in the shared
IntegrationsActions to make the admin / group controllers
cleaner.
parent f05a9968
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
class Admin::IntegrationsController < Admin::ApplicationController class Admin::IntegrationsController < Admin::ApplicationController
include IntegrationsActions include IntegrationsActions
include IntegrationsHelper
before_action :not_found, unless: -> { instance_level_integrations? } before_action :not_found, unless: -> { instance_level_integrations? }
......
...@@ -5,6 +5,7 @@ module IntegrationsActions ...@@ -5,6 +5,7 @@ module IntegrationsActions
included do included do
include Integrations::Params include Integrations::Params
include IntegrationsHelper
before_action :integration, only: [:edit, :update, :overrides, :test] before_action :integration, only: [:edit, :update, :overrides, :test]
end end
......
...@@ -4,7 +4,6 @@ module Groups ...@@ -4,7 +4,6 @@ module Groups
module Settings module Settings
class IntegrationsController < Groups::ApplicationController class IntegrationsController < Groups::ApplicationController
include IntegrationsActions include IntegrationsActions
include IntegrationsHelper
before_action :authorize_admin_group! before_action :authorize_admin_group!
......
...@@ -108,7 +108,7 @@ RSpec.describe Admin::IntegrationsController do ...@@ -108,7 +108,7 @@ RSpec.describe Admin::IntegrationsController do
get :overrides, params: { id: instance_integration.class.to_param }, format: format get :overrides, params: { id: instance_integration.class.to_param }, format: format
end end
context 'when format is HTML' do context 'when format is JSON' do
let(:format) { :json } let(:format) { :json }
include_context 'JSON response' include_context 'JSON response'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment