diff options
Diffstat (limited to 'spec/features/projects/branches_spec.rb')
-rw-r--r-- | spec/features/projects/branches_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/projects/branches_spec.rb b/spec/features/projects/branches_spec.rb index fc7833809b3..e1f1a63565c 100644 --- a/spec/features/projects/branches_spec.rb +++ b/spec/features/projects/branches_spec.rb @@ -201,6 +201,12 @@ RSpec.describe 'Branches', feature_category: :projects do end end + describe 'Link to branch rules' do + it 'does not have possibility to navigate to branch rules', :js do + expect(page).not_to have_content(s_("Branches|View branch rules")) + end + end + context 'on project with 0 branch' do let(:project) { create(:project, :public, :empty_repo) } let(:repository) { project.repository } @@ -239,6 +245,17 @@ RSpec.describe 'Branches', feature_category: :projects do expect(page).not_to have_content 'Merge request' end end + + describe 'Navigate to branch rules from branches page' do + it 'shows repository settings page with Branch rules section expanded' do + visit project_branches_path(project) + + view_branch_rules + + expect(page).to have_content( + _('Define rules for who can push, merge, and the required approvals for each branch.')) + end + end end end @@ -353,4 +370,11 @@ RSpec.describe 'Branches', feature_category: :projects do click_button 'Yes, delete branch' end end + + def view_branch_rules + page.within('.nav-controls') do + click_link s_("Branches|View branch rules") + end + wait_for_requests + end end |