Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (33 sloc) 1.05 KB
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Env do
before(:each) do
$cached_find = nil
teardown_tests
setup_tests
end
describe :associations do
it "should belong to a site" do
@env.site.nil?.should == false
@env.site.should == @site
end
it "should belong to a user" do
@env.user.nil?.should == false
@env.user.should == @user
end
end
describe :domain_match? do
it "should return true if match" do
@env.domain_match?('http://localhost:9393/blah').should == true
@env.domain_match?('http://test.com').should == true
end
it "should return false if no match" do
@env.domain_match?('http://blah.com:9393/blah').should == false
@env.domain_match?('http://blah.com').should == false
end
it "should return true if no domains specified" do
@env.domains = nil
@env.domain_match?('http://blah.com:9393/blah').should == true
@env.domain_match?('http://blah.com').should == true
end
end
end
Something went wrong with that request. Please try again.