diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-07-18 18:09:14 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-07-26 14:47:50 +0300 |
commit | b5bdc55d239f3e19f8fe1e59b118da05ac81a0dd (patch) | |
tree | 507f7b46386d518cdb7b77fa4048d7f4d77eec37 /spec/features/projects | |
parent | 0aa8249e484ca97cfc28c7301d69077919032c08 (diff) |
Move exception handling to execute
Diffstat (limited to 'spec/features/projects')
-rw-r--r-- | spec/features/projects/show_project_spec.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/spec/features/projects/show_project_spec.rb b/spec/features/projects/show_project_spec.rb index 5aa0d8f0026..1bc6fae9e7f 100644 --- a/spec/features/projects/show_project_spec.rb +++ b/spec/features/projects/show_project_spec.rb @@ -3,28 +3,18 @@ require 'spec_helper' describe 'Project show page', feature: true do context 'when project pending delete' do let(:project) { create(:project, :empty_repo, pending_delete: true) } - let(:worker) { ProjectDestroyWorker.new } before do sign_in(project.owner) end - it 'shows flash error if deletion for project fails' do - error_message = "some error message" - project.update_attributes(delete_error: error_message, pending_delete: false) + it 'shows error message if deletion for project fails' do + project.update_attributes(delete_error: "Something went wrong", pending_delete: false) - visit namespace_project_path(project.namespace, project) + visit project_path(project) expect(page).to have_selector('.project-deletion-failed-message') - expect(page).to have_content("This project was scheduled for deletion, but failed with the following message: #{error_message}") - end - - it 'renders 404 if project was successfully deleted' do - worker.perform(project.id, project.owner.id, {}) - - visit namespace_project_path(project.namespace, project) - - expect(page).to have_http_status(404) + expect(page).to have_content("This project was scheduled for deletion, but failed with the following message: #{project.delete_error}") end end end |