2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-17 02:12:03 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Projects > Settings > User archives a project' do
|
2017-09-17 02:12:03 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2017-09-17 02:12:03 -04:00
|
|
|
|
|
|
|
sign_in(user)
|
2018-04-06 08:40:33 -04:00
|
|
|
|
|
|
|
visit edit_project_path(project)
|
2017-09-17 02:12:03 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when a project is archived' do
|
|
|
|
let(:project) { create(:project, :archived, namespace: user.namespace) }
|
|
|
|
|
|
|
|
it 'unarchives a project' do
|
|
|
|
expect(page).to have_content('Unarchive project')
|
|
|
|
|
|
|
|
click_link('Unarchive')
|
|
|
|
|
|
|
|
expect(page).not_to have_content('Archived project')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when a project is unarchived' do
|
|
|
|
let(:project) { create(:project, :repository, namespace: user.namespace) }
|
|
|
|
|
|
|
|
it 'archives a project' do
|
|
|
|
expect(page).to have_content('Archive project')
|
|
|
|
|
|
|
|
click_link('Archive')
|
|
|
|
|
|
|
|
expect(page).to have_content('Archived')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|