diff options
author | Aakriti Gupta <agupta@gitlab.com> | 2019-11-06 19:07:11 +0300 |
---|---|---|
committer | Aakriti Gupta <agupta@gitlab.com> | 2019-11-20 12:35:58 +0300 |
commit | 9e674f92a3e3f2c4f524517cfa31864525844095 (patch) | |
tree | 6a8547acea5dfd13d3e50580fec644f0710b4acb /spec/features/cycle_analytics_spec.rb | |
parent | 7bc0aff0b4e15fce828621d7e0919d84368f3d2b (diff) |
Prevent guests from seeing commits for cycle analytics
- if the user has access level lower than REPORTER,
don't include commit count in summary
Diffstat (limited to 'spec/features/cycle_analytics_spec.rb')
-rw-r--r-- | spec/features/cycle_analytics_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/features/cycle_analytics_spec.rb b/spec/features/cycle_analytics_spec.rb index 0fc4841ee0e..e9751aa2e72 100644 --- a/spec/features/cycle_analytics_spec.rb +++ b/spec/features/cycle_analytics_spec.rb @@ -112,6 +112,10 @@ describe 'Cycle Analytics', :js do wait_for_requests end + it 'does not show the commit stats' do + expect(page).to have_no_selector(:xpath, commits_counter_selector) + end + it 'needs permissions to see restricted stages' do expect(find('.stage-events')).to have_content(issue.title) @@ -127,8 +131,12 @@ describe 'Cycle Analytics', :js do find(:xpath, "//p[contains(text(),'New Issue')]/preceding-sibling::h3") end + def commits_counter_selector + "//p[contains(text(),'Commits')]/preceding-sibling::h3" + end + def commits_counter - find(:xpath, "//p[contains(text(),'Commits')]/preceding-sibling::h3") + find(:xpath, commits_counter_selector) end def deploys_counter |