Sha256: 324f5fd44c30688c41ebdb7d3136d86ea26fc7dbc63f076a3b072b36e29502a1
Contents?: true
Size: 849 Bytes
Versions: 12
Compression:
Stored size: 849 Bytes
Contents
require 'spec_helper' describe Apartment::Elevators::Domain do describe "#parse_database_name" do it "parses the host for a domain name" do request = ActionDispatch::Request.new('HTTP_HOST' => 'example.com') elevator = Apartment::Elevators::Domain.new(nil) elevator.parse_database_name(request).should == 'example' end it "ignores a www prefix and domain suffix" do request = ActionDispatch::Request.new('HTTP_HOST' => 'www.example.bc.ca') elevator = Apartment::Elevators::Domain.new(nil) elevator.parse_database_name(request).should == 'example' end it "returns nil if there is no host" do request = ActionDispatch::Request.new('HTTP_HOST' => '') elevator = Apartment::Elevators::Domain.new(nil) elevator.parse_database_name(request).should be_nil end end end
Version data entries
12 entries across 12 versions & 1 rubygems