diff options
Diffstat (limited to 'spec/lib/gitlab/api_authentication/sent_through_builder_spec.rb')
-rw-r--r-- | spec/lib/gitlab/api_authentication/sent_through_builder_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/api_authentication/sent_through_builder_spec.rb b/spec/lib/gitlab/api_authentication/sent_through_builder_spec.rb new file mode 100644 index 00000000000..845e317f3aa --- /dev/null +++ b/spec/lib/gitlab/api_authentication/sent_through_builder_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'fast_spec_helper' + +RSpec.describe Gitlab::APIAuthentication::SentThroughBuilder do + describe '#sent_through' do + let(:resolvers) { Array.new(3) { double } } + let(:locators) { Array.new(3) { double } } + + it 'adds a strategy for each of locators x resolvers' do + strategies = locators.to_h { |l| [l, []] } + described_class.new(strategies, resolvers).sent_through(*locators) + + expect(strategies).to eq(locators.to_h { |l| [l, resolvers] }) + end + end +end |