diff options
Diffstat (limited to 'spec/features/users/overview_spec.rb')
-rw-r--r-- | spec/features/users/overview_spec.rb | 70 |
1 files changed, 55 insertions, 15 deletions
diff --git a/spec/features/users/overview_spec.rb b/spec/features/users/overview_spec.rb index 549087e5950..67216b04504 100644 --- a/spec/features/users/overview_spec.rb +++ b/spec/features/users/overview_spec.rb @@ -21,15 +21,15 @@ RSpec.describe 'Overview tab on a user profile', :js do sign_in user end - describe 'activities section' do - shared_context 'visit overview tab' do - before do - visit user.username - page.find('.js-overview-tab a').click - wait_for_requests - end + shared_context 'visit overview tab' do + before do + visit user.username + page.find('.js-overview-tab a').click + wait_for_requests end + end + describe 'activities section' do describe 'user has no activities' do include_context 'visit overview tab' @@ -84,14 +84,6 @@ RSpec.describe 'Overview tab on a user profile', :js do end describe 'projects section' do - shared_context 'visit overview tab' do - before do - visit user.username - page.find('.js-overview-tab a').click - wait_for_requests - end - end - describe 'user has no personal projects' do include_context 'visit overview tab' @@ -158,4 +150,52 @@ RSpec.describe 'Overview tab on a user profile', :js do end end end + + describe 'bot user' do + let(:bot_user) { create(:user, user_type: :security_bot) } + + shared_context "visit bot's overview tab" do + before do + visit bot_user.username + page.find('.js-overview-tab a').click + wait_for_requests + end + end + + describe 'feature flag enabled' do + before do + stub_feature_flags(security_auto_fix: true) + end + + include_context "visit bot's overview tab" + + it "activity panel's title is 'Bot activity'" do + page.within('.activities-block') do + expect(page).to have_text('Bot activity') + end + end + + it 'does not show projects panel' do + expect(page).not_to have_selector('.projects-block') + end + end + + describe 'feature flag disabled' do + before do + stub_feature_flags(security_auto_fix: false) + end + + include_context "visit bot's overview tab" + + it "activity panel's title is not 'Bot activity'" do + page.within('.activities-block') do + expect(page).not_to have_text('Bot activity') + end + end + + it 'shows projects panel' do + expect(page).to have_selector('.projects-block') + end + end + end end |