diff options
Diffstat (limited to 'spec/lib/gitlab/sql/union_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sql/union_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/lib/gitlab/sql/union_spec.rb b/spec/lib/gitlab/sql/union_spec.rb index fe6422c32b6..b77bd3a1d2a 100644 --- a/spec/lib/gitlab/sql/union_spec.rb +++ b/spec/lib/gitlab/sql/union_spec.rb @@ -12,7 +12,7 @@ describe Gitlab::SQL::Union do it 'returns a String joining relations together using a UNION' do union = described_class.new([relation_1, relation_2]) - expect(union.to_sql).to eq("#{to_sql(relation_1)}\nUNION\n#{to_sql(relation_2)}") + expect(union.to_sql).to eq("(#{to_sql(relation_1)})\nUNION\n(#{to_sql(relation_2)})") end it 'skips Model.none segements' do @@ -20,7 +20,7 @@ describe Gitlab::SQL::Union do union = described_class.new([empty_relation, relation_1, relation_2]) expect {User.where("users.id IN (#{union.to_sql})").to_a}.not_to raise_error - expect(union.to_sql).to eq("#{to_sql(relation_1)}\nUNION\n#{to_sql(relation_2)}") + expect(union.to_sql).to eq("(#{to_sql(relation_1)})\nUNION\n(#{to_sql(relation_2)})") end it 'uses UNION ALL when removing duplicates is disabled' do |