Sha256: d6b20f3332bc7754aa3bccf00c1bcd98c26cae2f6c8fd7bbc73d182ca555c012
Contents?: true
Size: 1.12 KB
Versions: 17
Compression:
Stored size: 1.12 KB
Contents
require "spec_helper" module Scenic module Adapters describe Postgres::Views, :db do it "returns scenic view objects for plain old views" do connection = ActiveRecord::Base.connection connection.execute <<-SQL CREATE VIEW children AS SELECT text 'Elliot' AS name SQL views = Postgres::Views.new(connection).all first = views.first expect(views.size).to eq 1 expect(first.name).to eq "children" expect(first.materialized).to be false expect(first.definition).to eq "SELECT 'Elliot'::text AS name;" end it "returns scenic view objects for materialized views" do connection = ActiveRecord::Base.connection connection.execute <<-SQL CREATE MATERIALIZED VIEW children AS SELECT text 'Owen' AS name SQL views = Postgres::Views.new(connection).all first = views.first expect(views.size).to eq 1 expect(first.name).to eq "children" expect(first.materialized).to be true expect(first.definition).to eq "SELECT 'Owen'::text AS name;" end end end end
Version data entries
17 entries across 17 versions & 2 rubygems