spec/unit/elevators/domain_spec.rb in apartment-1.0.2 vs spec/unit/elevators/domain_spec.rb in apartment-1.1.0
- old
+ new
@@ -6,26 +6,26 @@
subject(:elevator){ described_class.new(Proc.new{}) }
describe "#parse_tenant_name" do
it "parses the host for a domain name" do
request = ActionDispatch::Request.new('HTTP_HOST' => 'example.com')
- elevator.parse_tenant_name(request).should == 'example'
+ expect(elevator.parse_tenant_name(request)).to eq('example')
end
it "ignores a www prefix and domain suffix" do
request = ActionDispatch::Request.new('HTTP_HOST' => 'www.example.bc.ca')
- elevator.parse_tenant_name(request).should == 'example'
+ expect(elevator.parse_tenant_name(request)).to eq('example')
end
it "returns nil if there is no host" do
request = ActionDispatch::Request.new('HTTP_HOST' => '')
- elevator.parse_tenant_name(request).should be_nil
+ expect(elevator.parse_tenant_name(request)).to be_nil
end
end
describe "#call" do
it "switches to the proper tenant" do
- Apartment::Tenant.should_receive(:switch!).with('example')
+ expect(Apartment::Tenant).to receive(:switch).with('example')
elevator.call('HTTP_HOST' => 'www.example.com')
end
end
end