Sha256: e09ad60de8fc5fbdb2248736cefc36a6f2922afb81a8995f2a225e262324dd0d
Contents?: true
Size: 1016 Bytes
Versions: 12
Compression:
Stored size: 1016 Bytes
Contents
require "spec_helper" describe PgSearch::Configuration::ForeignColumn do describe "#alias" do with_model :AssociatedModel do table do |t| t.string "title" end end with_model :Model do table do |t| t.string "title" t.belongs_to :another_model end model do include PgSearch belongs_to :another_model, :class_name => 'AssociatedModel' pg_search_scope :with_another, :associated_against => {:another_model => :title} end end it "returns a consistent string" do association = PgSearch::Configuration::Association.new(Model, :another_model, :title) foreign_column = described_class.new("title", nil, Model, association) column_alias = foreign_column.alias expect(column_alias).to be_a String expect(foreign_column.alias).to eq column_alias end end end
Version data entries
12 entries across 12 versions & 1 rubygems