Sha256: 7ab72723ffd4a589f5b6d094a7f3bd92e8e0c735b319da4be773eb7724f3a9ac
Contents?: true
Size: 1.15 KB
Versions: 20
Compression:
Stored size: 1.15 KB
Contents
require 'spec_helper' require_relative '../../../lib/locomotive/steam/adapters/filesystem.rb' require_relative '../../../lib/locomotive/steam/adapters/mongodb.rb' describe Locomotive::Steam::SiteRepository do let(:repository) { described_class.new(adapter) } shared_examples_for 'a repository' do describe '#query' do subject { repository.query { where(handle: 'sample') }.first } it { expect(subject.name).to eq 'Sample site' } end describe '#by_domain' do subject { repository.by_domain('sample.example.com') } it { expect(subject).not_to eq nil } end end context 'MongoDB' do let(:adapter) { Locomotive::Steam::MongoDBAdapter.new(database: mongodb_database, hosts: ['127.0.0.1:27017']) } it_behaves_like 'a repository' describe '#all' do subject { repository.all } it { expect(subject.size).to eq 2 } end end context 'Filesystem' do let(:adapter) { Locomotive::Steam::FilesystemAdapter.new(default_fixture_site_path) } it_behaves_like 'a repository' describe '#all' do subject { repository.all } it { expect(subject.size).to eq 1 } end end end
Version data entries
20 entries across 20 versions & 1 rubygems