Commit 21a713f9 authored by Matija Čupić's avatar Matija Čupić

Change reset_cache action from get to post

parent d66c48b3
......@@ -50,10 +50,9 @@ export default {
Get started with Pipelines
</a>
<a :href="resetCachePath"
class="btn btn-default">
Clear runner caches
</a>
<form :action="resetCachePath" method="post">
<input type="submit" class="btn btn-default" value="Clear runner caches" />
</form>
<a
:href="ciLintPath"
......
......@@ -409,7 +409,7 @@ constraints(ProjectUrlConstrainer.new) do
namespace :settings do
get :members, to: redirect("%{namespace_id}/%{project_id}/project_members")
resource :ci_cd, only: [:show], controller: 'ci_cd' do
get :reset_cache
post :reset_cache
end
resource :integrations, only: [:show]
resource :repository, only: [:show], controller: :repository
......
......@@ -27,7 +27,7 @@ describe Projects::Settings::CiCdController do
allow(ResetProjectCacheService).to receive_message_chain(:new, :execute).and_return(true)
end
subject { get :reset_cache, namespace_id: project.namespace, project_id: project }
subject { post :reset_cache, namespace_id: project.namespace, project_id: project }
it 'calls reset project cache service' do
expect(ResetProjectCacheService).to receive_message_chain(:new, :execute)
......
......@@ -58,7 +58,7 @@ describe('Pipelines Nav Controls', () => {
}).$mount();
expect(component.$el.querySelectorAll('.btn-default')[0].textContent).toContain('Clear runner caches');
expect(component.$el.querySelectorAll('.btn-default')[0].getAttribute('href')).toEqual(mockData.resetCachePath);
expect(component.$el.querySelector('form').getAttribute('action')).toEqual(mockData.resetCachePath);
});
it('should render link for CI lint', () => {
......
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