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