Commit b71b0acd authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'zj-fix-admin-templates' into 'master'

Fix Slash command templates

Closes #26042

See merge request !8320
parents d3f26be6 df99883d
......@@ -8,8 +8,8 @@
by entering
%code /<command_trigger_word> help
- unless enabled
- unless enabled || @service.template?
= render 'projects/services/mattermost_slash_commands/detailed_help', subject: @service
- if enabled
- if enabled && !@service.template?
= render 'projects/services/mattermost_slash_commands/installation_info', subject: @service
- run_actions_text = "Perform common operations on this project: #{@project.name_with_namespace}"
- pretty_name = defined?(@project) ? @project.name_with_namespace : "namespace / path"
- run_actions_text = "Perform common operations on this project: #{pretty_name}"
.well
This service allows GitLab users to perform common operations on this
......@@ -9,6 +10,7 @@
%code /<command> help
%br
%br
- unless @service.template?
To setup this service:
%ul.list-unstyled
%li
......
require 'spec_helper'
describe Admin::ServicesController do
let(:admin) { create(:admin) }
before { sign_in(admin) }
describe 'GET #edit' do
let!(:project) { create(:empty_project) }
Service.available_services_names.each do |service_name|
context "#{service_name}" do
let!(:service) do
service_template = service_name.concat("_service").camelize.constantize
service_template.where(template: true).first_or_create
end
it 'successfully displays the template' do
get :edit, id: service.id
expect(response).to have_http_status(200)
end
end
end
end
end
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