Change reset_cache action from get to post
This commit is contained in:
parent
d66c48b303
commit
21a713f9c4
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue