mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
added spec for localhost embeddable host validation
This commit is contained in:
parent
e9db03e465
commit
afa88f68ce
1 changed files with 23 additions and 0 deletions
|
@ -26,6 +26,29 @@ describe EmbeddableHost do
|
|||
expect(eh.host).to eq('192.168.0.1')
|
||||
end
|
||||
|
||||
it "supports localhost" do
|
||||
eh = EmbeddableHost.new(host: 'localhost')
|
||||
expect(eh).to be_valid
|
||||
expect(eh.host).to eq('localhost')
|
||||
end
|
||||
|
||||
it "supports ports of localhost" do
|
||||
eh = EmbeddableHost.new(host: 'localhost:8080')
|
||||
expect(eh).to be_valid
|
||||
expect(eh.host).to eq('localhost:8080')
|
||||
end
|
||||
|
||||
it "supports subdomains of localhost" do
|
||||
eh = EmbeddableHost.new(host: 'discourse.localhost')
|
||||
expect(eh).to be_valid
|
||||
expect(eh.host).to eq('discourse.localhost')
|
||||
end
|
||||
|
||||
it "rejects misspellings of localhost" do
|
||||
eh = EmbeddableHost.new(host: 'alocalhost')
|
||||
expect(eh).not_to be_valid
|
||||
end
|
||||
|
||||
describe "allows_embeddable_host" do
|
||||
let!(:host) { Fabricate(:embeddable_host) }
|
||||
|
||||
|
|
Loading…
Reference in a new issue