blob: 5d82dff1efda82b3e2636218aca27c8baef79e10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Project settings > repositories > Branch names', :js, feature_category: :projects do
let_it_be(:project) { create(:project, :public) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
sign_in(user)
end
context 'when Issues are initially disabled' do
let(:project_feature) { project.project_feature }
before do
project_feature.update!(issues_access_level: ProjectFeature::DISABLED)
visit project_settings_repository_path(project)
end
it 'do not render the Branch names settings' do
expect(page).not_to have_content('Branch name template')
end
end
context 'when Issues are initially enabled' do
before do
visit project_settings_repository_path(project)
end
it 'shows the Branch names settings' do
expect(page).to have_content('Branch name template')
value = "feature-%{id}"
within('section#branch-defaults-settings') do
fill_in 'project[issue_branch_template]', with: value
click_on('Save changes')
end
expect(project.reload.issue_branch_template).to eq(value)
expect(page).to have_content('Branch name template')
end
end
end
|