mirror of
https://github.com/discourse/discourse.git
synced 2026-08-26 21:27:16 -05:00
BUGFIX: invalid referer would cause 500 errors
This commit is contained in:
@@ -62,6 +62,12 @@ describe IncomingLink do
|
||||
IncomingLink.add(req('http://somesite.com', 'http://somesite.com'))
|
||||
end
|
||||
|
||||
it "tracks visits for invalid referers" do
|
||||
IncomingLink.add(req('http://somesite.com', 'bang bang bang'))
|
||||
# no current user, don't track
|
||||
IncomingLink.count.should == 0
|
||||
end
|
||||
|
||||
it "expects to be called with referer and user id" do
|
||||
IncomingLink.expects(:create).once.returns(true)
|
||||
IncomingLink.add(req('http://somesite.com', 'http://some.other.site.com'), build(:user))
|
||||
|
||||
Reference in New Issue
Block a user