2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Projects > Show > User sees a deletion failure message' do
|
2018-10-15 14:42:47 +05:30
|
|
|
let(:project) { create(:project, :empty_repo, pending_delete: true) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(project.owner)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows error message if deletion for project fails' do
|
2021-04-29 21:17:54 +05:30
|
|
|
project.update!(delete_error: "Something went wrong", pending_delete: false)
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
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: #{project.delete_error}")
|
|
|
|
end
|
|
|
|
end
|