diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-14 12:08:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-14 12:08:03 +0000 |
commit | 61a82b8ec062d6f122dadd38783c7754cef7ce2b (patch) | |
tree | 071d1ded4f507d77bac97156aa1fa85c95c0cba5 /spec/controllers/concerns | |
parent | 3ed578edf525bce3167860b84f6b43bab5065cf5 (diff) | |
download | gitlab-ce-61a82b8ec062d6f122dadd38783c7754cef7ce2b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/concerns')
-rw-r--r-- | spec/controllers/concerns/issuable_actions_spec.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/controllers/concerns/issuable_actions_spec.rb b/spec/controllers/concerns/issuable_actions_spec.rb index c3fef591b91..37d9dc080e1 100644 --- a/spec/controllers/concerns/issuable_actions_spec.rb +++ b/spec/controllers/concerns/issuable_actions_spec.rb @@ -6,8 +6,8 @@ RSpec.describe IssuableActions do let(:project) { double('project') } let(:user) { double('user') } let(:issuable) { double('issuable') } - let(:finder_params_for_issuable) { {} } - let(:notes_result) { double('notes_result') } + let(:finder_params_for_issuable) { { project: project, target: issuable } } + let(:notes_result) { [] } let(:discussion_serializer) { double('discussion_serializer') } let(:controller) do @@ -55,13 +55,20 @@ RSpec.describe IssuableActions do end it 'instantiates and calls NotesFinder as expected' do + expect(issuable).to receive(:to_ability_name).and_return('issue') + expect(issuable).to receive(:project).and_return(project) + expect(Ability).to receive(:allowed?).at_least(1).and_return(true) expect(Discussion).to receive(:build_collection).and_return([]) expect(DiscussionSerializer).to receive(:new).and_return(discussion_serializer) expect(NotesFinder).to receive(:new).with(user, finder_params_for_issuable).and_call_original expect_any_instance_of(NotesFinder).to receive(:execute).and_return(notes_result) - expect(notes_result).to receive_messages(inc_relations_for_view: notes_result, includes: notes_result, fresh: notes_result) + expect(notes_result).to receive_messages( + with_web_entity_associations: notes_result, + inc_relations_for_view: notes_result, + fresh: notes_result + ) controller.discussions end |