1 require 'spec_helper_acceptance'
3 # These tests are designed to ensure that the module, when ran with defaults,
4 # sets up everything correctly and allows us to connect to Postgres.
5 describe 'postgresql::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
8 class { 'postgresql::globals':
12 class { 'postgresql::server': }
15 apply_manifest(pp, :catch_failures => true)
16 apply_manifest(pp, :catch_changes => true)
19 describe port(5432) do
20 it { is_expected.to be_listening }
23 it 'can connect with psql' do
24 psql('--command="\l" postgres', 'postgres') do |r|
25 expect(r.stdout).to match(/List of databases/)
29 it 'must set UTF8 as template1 encoding' do
30 psql('--command="SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname=\'template1\'"') do |r|
31 expect(r.stdout).to match(/UTF8/)