diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-09-19 10:30:18 +0200 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-10-03 11:26:12 +0200 |
commit | 7f69659a5d932ef6cac72001b19b89a103535bd9 (patch) | |
tree | a3347547fbe50fd7f802a57fcac8b52c12cdd52e /spec/controllers | |
parent | 69f0370ad398db0202e3d0cf8459145ea08826dd (diff) | |
download | gitlab-ce-7f69659a5d932ef6cac72001b19b89a103535bd9.tar.gz |
Remove edit action for issues
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/issues_controller_spec.rb | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index b4a22a46b51..166a299fc80 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -259,7 +259,7 @@ describe Projects::IssuesController do context 'when captcha is not verified' do def update_spam_issue - update_issue(title: 'Spam Title', description: 'Spam lives here') + update_issue({ title: 'Spam Title', description: 'Spam lives here' }, format: :json) end before do @@ -267,7 +267,6 @@ describe Projects::IssuesController do end it 'rejects an issue recognized as a spam' do - expect(Gitlab::Recaptcha).to receive(:load_configurations!).and_return(true) expect { update_spam_issue }.not_to change { issue.reload.title } end @@ -287,14 +286,6 @@ describe Projects::IssuesController do expect(spam_logs.first.recaptcha_verified).to be_falsey end - context 'as HTML' do - it 'renders verify template' do - update_spam_issue - - expect(response).to render_template(:verify) - end - end - context 'as JSON' do before do update_issue({ title: 'Spam Title', description: 'Spam lives here' }, format: :json) @@ -318,7 +309,7 @@ describe Projects::IssuesController do def update_verified_issue update_issue({ title: spammy_title }, { spam_log_id: spam_logs.last.id, - recaptcha_verification: true }) + recaptcha_verification: true, format: :json }) end before do @@ -326,11 +317,8 @@ describe Projects::IssuesController do .and_return(true) end - it 'redirect to issue page' do - update_verified_issue - - expect(response) - .to redirect_to(project_issue_path(project, issue)) + it 'returns 200 status' do + expect(response).to have_http_status(200) end it 'accepts an issue after recaptcha is verified' do @@ -574,26 +562,16 @@ describe Projects::IssuesController do end end - describe 'GET #edit' do - it_behaves_like 'restricted action', success: 200 - - def go(id:) - get :edit, - namespace_id: project.namespace.to_param, - project_id: project, - id: id - end - end - describe 'PUT #update' do - it_behaves_like 'restricted action', success: 302 + it_behaves_like 'restricted action', success: 200 def go(id:) put :update, namespace_id: project.namespace.to_param, project_id: project, id: id, - issue: { title: 'New title' } + issue: { title: 'New title' }, + format: :json end end end |