Sha256: 21c4ba3b3c881099316674d1215f7ee657ec516477331df4ad911df8c7fdf441

Contents?: true

Size: 645 Bytes

Versions: 9

Compression:

Stored size: 645 Bytes

Contents

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

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

    context "one subdomain" do
      let(:subdomain) { "test" }
      it { is_expected.to eq("test") }
    end

    context "nested subdomains" do
      let(:subdomain) { "test1.test2" }
      it { is_expected.to eq("test1") }
    end
    
    context "no subdomain" do
      let(:subdomain) { nil }
      it { is_expected.to eq(nil) }
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
ros-apartment-2.3.0 spec/unit/elevators/first_subdomain_spec.rb
ros-apartment-2.3.0.alpha2 spec/unit/elevators/first_subdomain_spec.rb
ros-apartment-2.3.0.alpha1 spec/unit/elevators/first_subdomain_spec.rb
apartment-2.2.1 spec/unit/elevators/first_subdomain_spec.rb
apartment-2.2.0 spec/unit/elevators/first_subdomain_spec.rb
apartment-2.1.0 spec/unit/elevators/first_subdomain_spec.rb
apartment-2.0.0 spec/unit/elevators/first_subdomain_spec.rb
apartment-1.2.0 spec/unit/elevators/first_subdomain_spec.rb
apartment-1.1.0 spec/unit/elevators/first_subdomain_spec.rb