Sha256: 00a9c24803b4882f986102827580203f7c5e77823308cf691832e2fdb047f801

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

require 'spec_helper'
require 'apartment/elevators/first_subdomain'

describe Apartment::Elevators::FirstSubdomain do
  describe "subdomain" do
    subject { described_class.new("test").parse_database_name(request) }
    let(:request) { double(:request, :host => "#{subdomain}.example.com") }

    context "one subdomain" do
      let(:subdomain) { "test" }
      it { should == "test" }
    end

    context "nested subdomains" do
      let(:subdomain) { "test1.test2" }
      it { should == "test1" }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apartment-0.23.0 spec/unit/middleware/first_subdomain_elevator_spec.rb