mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:51:05 +08:00
PERF: reduce storage requirements for incoming links
Only store incoming links for topics.
This commit is contained in:
@ -24,13 +24,6 @@ describe TopicsController do
|
||||
lambda { get :show, {id: topic.id} }.should_not raise_error
|
||||
end
|
||||
|
||||
it "stores an incoming link when there is an off-site referer" do
|
||||
lambda {
|
||||
set_referer("http://google.com/search")
|
||||
get :show, {id: topic.id}
|
||||
}.should change(IncomingLink, :count).by(1)
|
||||
end
|
||||
|
||||
describe "has_escaped_fragment?" do
|
||||
render_views
|
||||
|
||||
@ -92,19 +85,6 @@ describe TopicsController do
|
||||
|
||||
end
|
||||
|
||||
describe 'after inserting an incoming link' do
|
||||
|
||||
it 'sets last link correctly' do
|
||||
set_referer("http://google.com/search")
|
||||
get :show, {topic_id: topic.id}
|
||||
|
||||
last_link = IncomingLink.last
|
||||
last_link.topic_id.should == topic.id
|
||||
last_link.post_number.should == 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'set_locale' do
|
||||
it 'sets the one the user prefers' do
|
||||
SiteSetting.stubs(:allow_user_locale).returns(true)
|
||||
|
Reference in New Issue
Block a user