Commit 51e2a823 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Add retry_auto_ssl action to pages domains controller

parent e031346c
......@@ -26,6 +26,12 @@ class Projects::PagesDomainsController < Projects::ApplicationController
redirect_to project_pages_domain_path(@project, @domain)
end
def retry_auto_ssl
PagesDomains::RetryAcmeOrderService.new(@domain).execute
redirect_to project_pages_domain_path(@project, @domain)
end
def edit
redirect_to project_pages_domain_path(@project, @domain)
end
......
......@@ -338,6 +338,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :domains, except: :index, controller: 'pages_domains', constraints: { id: %r{[^/]+} } do
member do
post :verify
post :retry_auto_ssl
delete :clean_certificate
end
end
......
......@@ -181,6 +181,24 @@ describe Projects::PagesDomainsController do
end
end
describe 'POST retry_auto_ssl' do
before do
pages_domain.update!(auto_ssl_enabled: true, auto_ssl_failed: true)
end
let(:params) { request_params.merge(id: pages_domain.domain) }
it 'calls retry service and redirects' do
expect_next_instance_of(PagesDomains::RetryAcmeOrderService, pages_domain) do |service|
expect(service).to receive(:execute)
end
post :retry_auto_ssl, params: params
expect(response).to redirect_to project_pages_domain_path(project, pages_domain)
end
end
describe 'DELETE destroy' do
it "deletes the pages domain" do
expect do
......
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