Commit 1e607251 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rs-fix-master' into 'master'

Ensure `issuables_count_for_state` returns the requested state count

Closes #37353

See merge request !14005
parents 223849fa 7cc19cd5
...@@ -242,7 +242,7 @@ module IssuablesHelper ...@@ -242,7 +242,7 @@ module IssuablesHelper
def issuables_count_for_state(issuable_type, state) def issuables_count_for_state(issuable_type, state)
finder = public_send("#{issuable_type}_finder") # rubocop:disable GitlabSecurity/PublicSend finder = public_send("#{issuable_type}_finder") # rubocop:disable GitlabSecurity/PublicSend
finder.count_by_state finder.count_by_state[state]
end end
def close_issuable_url(issuable) def close_issuable_url(issuable)
......
...@@ -519,7 +519,7 @@ describe Issues::UpdateService, :mailer do ...@@ -519,7 +519,7 @@ describe Issues::UpdateService, :mailer do
end end
it 'calls the move service with the proper issue and project' do it 'calls the move service with the proper issue and project' do
move_stub = class_double("Issues::MoveService").as_stubbed_const move_stub = instance_double(Issues::MoveService)
allow(Issues::MoveService).to receive(:new).and_return(move_stub) allow(Issues::MoveService).to receive(:new).and_return(move_stub)
allow(move_stub).to receive(:execute).with(issue, target_project).and_return(issue) allow(move_stub).to receive(:execute).with(issue, target_project).and_return(issue)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment