Sha256: bfe3aa546856b6cc4fa70307fabb0ccfe6ed62c417bf06f428d5af2ce162c55f
Contents?: true
Size: 795 Bytes
Versions: 12
Compression:
Stored size: 795 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe PgSearch::Configuration::Column do describe "#full_name" do with_model :Model do table do |t| t.string :name end end it "returns the fully-qualified table and column name" do column = described_class.new("name", nil, Model) expect(column.full_name).to eq(%(#{Model.quoted_table_name}."name")) end end describe "#to_sql" do with_model :Model do table do |t| t.string :name end end it "returns an expression that casts the column to text and coalesces it with an empty string" do column = described_class.new("name", nil, Model) expect(column.to_sql).to eq(%{coalesce(#{Model.quoted_table_name}."name"::text, '')}) end end end
Version data entries
12 entries across 12 versions & 1 rubygems