spec/unit/relation/select_spec.rb in rom-sql-1.0.1 vs spec/unit/relation/select_spec.rb in rom-sql-1.0.2
- old
+ new
@@ -27,7 +27,14 @@
end
it 'supports blocks' do
expect(relation.select { [id, title] }.schema.map(&:name)).to eql(%i[id title])
end
+
+ it 'supports selecting literal strings' do
+ new_rel = relation.select { `'event'`.as(:type) }
+
+ expect(new_rel.schema[:type].primitive).to be(String)
+ expect(new_rel.first).to eql(type: 'event')
+ end
end
end