Here we go again - fixed sepcs
This commit is contained in:
parent
75d372c737
commit
e1d5f86f7e
1 changed files with 6 additions and 7 deletions
|
|
@ -6,38 +6,37 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe StatusMessagesHelper do
|
describe StatusMessagesHelper do
|
||||||
it "should not allow basic XSS/HTML" do
|
it "should not allow basic XSS/HTML" do
|
||||||
evil = "<script>alert('XSS is evil')</script>"
|
make_links("<script>alert('XSS is evil')</script>").should == "<script>alert('XSS is evil')</script>"
|
||||||
make_links(evil).should != evil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should recognize basic http links (1/3)" do
|
it "should recognize basic http links (1/3)" do
|
||||||
proto="http"
|
proto="http"
|
||||||
url="bugs.joindiaspora.com/issues/332"
|
url="bugs.joindiaspora.com/issues/332"
|
||||||
make_links(proto+"://"+url).should = "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
make_links(proto+"://"+url).should == "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should recognize basic http links (2/3)" do
|
it "should recognize basic http links (2/3)" do
|
||||||
proto="http"
|
proto="http"
|
||||||
url="www.youtube.com/watch?v=b15yaPYNDRU"
|
url="www.youtube.com/watch?v=b15yaPYNDRU"
|
||||||
make_links(proto+"://"+url).should = "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
make_links(proto+"://"+url).should == "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should recognize basic http links (3/3)" do
|
it "should recognize basic http links (3/3)" do
|
||||||
proto="http"
|
proto="http"
|
||||||
url="127.0.0.1:3000/users/sign_in"
|
url="127.0.0.1:3000/users/sign_in"
|
||||||
make_links(proto+"://"+url).should = "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
make_links(proto+"://"+url).should == "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should recognize basic ftp links" do
|
it "should recognize basic ftp links" do
|
||||||
proto="ftp"
|
proto="ftp"
|
||||||
url="ftp.uni-kl.de/CCC/26C3/mp4/26c3-3540-en-a_hackers_utopia.mp4"
|
url="ftp.uni-kl.de/CCC/26C3/mp4/26c3-3540-en-a_hackers_utopia.mp4"
|
||||||
# I did not watch that one, but the title sounds nice :P
|
# I did not watch that one, but the title sounds nice :P
|
||||||
make_links(proto+"://"+url).should = "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
make_links(proto+"://"+url).should == "<a target=\"_blank\" href=\""+proto+"://"+url+"\">"+url+"</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should recognize www links" do
|
it "should recognize www links" do
|
||||||
url="www.joindiaspora.com"
|
url="www.joindiaspora.com"
|
||||||
make_links(url).should = "<a target=\"_blank\" href=\"http://"+url+"\">"+url+"</a>"
|
make_links(url).should == "<a target=\"_blank\" href=\"http://"+url+"\">"+url+"</a>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue