diff options
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r-- | spec/features/dashboard/archived_projects_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/dashboard/issuables_counter_spec.rb | 78 | ||||
-rw-r--r-- | spec/features/dashboard/merge_requests_spec.rb | 4 |
3 files changed, 24 insertions, 60 deletions
diff --git a/spec/features/dashboard/archived_projects_spec.rb b/spec/features/dashboard/archived_projects_spec.rb index 1b349fa2276..d157d44bab7 100644 --- a/spec/features/dashboard/archived_projects_spec.rb +++ b/spec/features/dashboard/archived_projects_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Archived Project' do let(:user) { create :user } - let(:project) { create :project} + let(:project) { create :project } let(:archived_project) { create(:project, :archived) } before do diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb index f8b68be7f93..91901414dde 100644 --- a/spec/features/dashboard/issuables_counter_spec.rb +++ b/spec/features/dashboard/issuables_counter_spec.rb @@ -8,73 +8,41 @@ RSpec.describe 'Navigation bar counter', :use_clean_rails_memory_store_caching d let(:issue) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, source_project: project) } - describe 'feature flag mr_attention_requests is disabled' do - before do - stub_feature_flags(mr_attention_requests: false) - - issue.assignees = [user] - merge_request.update!(assignees: [user]) - sign_in(user) - end - - it 'reflects dashboard issues count' do - visit issues_path - - expect_counters('issues', '1', n_("%d assigned issue", "%d assigned issues", 1) % 1) - - issue.assignees = [] - - user.invalidate_cache_counts + before do + issue.assignees = [user] + merge_request.update!(assignees: [user]) + sign_in(user) + end - travel_to(3.minutes.from_now) do - visit issues_path + it 'reflects dashboard issues count' do + visit issues_path - expect_counters('issues', '0', n_("%d assigned issue", "%d assigned issues", 0) % 0) - end - end - - it 'reflects dashboard merge requests count', :js do - visit merge_requests_path + expect_counters('issues', '1', n_("%d assigned issue", "%d assigned issues", 1) % 1) - expect_counters('merge_requests', '1', n_("%d merge request", "%d merge requests", 1) % 1) + issue.assignees = [] - merge_request.update!(assignees: []) + user.invalidate_cache_counts - user.invalidate_cache_counts - - travel_to(3.minutes.from_now) do - visit merge_requests_path + travel_to(3.minutes.from_now) do + visit issues_path - expect_counters('merge_requests', '0', n_("%d merge request", "%d merge requests", 0) % 0) - end + expect_counters('issues', '0', n_("%d assigned issue", "%d assigned issues", 0) % 0) end end - describe 'feature flag mr_attention_requests is enabled' do - before do - merge_request.update!(assignees: [user]) - - merge_request.find_assignee(user).update!(state: :attention_requested) - - user.invalidate_attention_requested_count - - sign_in(user) - end - - it 'reflects dashboard merge requests count', :js do - visit merge_requests_attention_path + it 'reflects dashboard merge requests count', :js do + visit merge_requests_path - expect_counters('merge_requests', '1', n_("%d merge request", "%d merge requests", 1) % 1) + expect_counters('merge_requests', '1', n_("%d merge request", "%d merge requests", 1) % 1) - merge_request.find_assignee(user).update!(state: :reviewed) + merge_request.update!(assignees: []) - user.invalidate_attention_requested_count + user.invalidate_cache_counts - travel_to(3.minutes.from_now) do - visit merge_requests_attention_path + travel_to(3.minutes.from_now) do + visit merge_requests_path - expect_counters('merge_requests', '0', n_("%d merge request", "%d merge requests", 0) % 0) - end + expect_counters('merge_requests', '0', n_("%d merge request", "%d merge requests", 0) % 0) end end @@ -86,10 +54,6 @@ RSpec.describe 'Navigation bar counter', :use_clean_rails_memory_store_caching d merge_requests_dashboard_path(assignee_username: user.username) end - def merge_requests_attention_path - merge_requests_dashboard_path(attention: user.username) - end - def expect_counters(issuable_type, count, badge_label) dashboard_count = find('.gl-tabs-nav li a.active') diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index fd580b679ad..70f614cdcef 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -112,8 +112,8 @@ RSpec.describe 'Dashboard Merge Requests' do end it 'includes assigned and reviewers in badge' do - within("span[aria-label='#{n_("%d merge request", "%d merge requests", 0) % 0}']") do - expect(page).to have_content('0') + within("span[aria-label='#{n_("%d merge request", "%d merge requests", 3) % 3}']") do + expect(page).to have_content('3') end find('.dashboard-shortcuts-merge_requests').click |