display 'similar to' earlier when composing a post

This commit is contained in:
Régis Hanol
2017-09-16 01:03:29 +02:00
parent 32972de2d7
commit 8ed318c4fe
7 changed files with 41 additions and 69 deletions

View File

@ -10,10 +10,6 @@ describe SimilarTopicsController do
expect { xhr :get, :index, raw: raw }.to raise_error(ActionController::ParameterMissing)
end
it "requires a raw body" do
expect { xhr :get, :index, title: title }.to raise_error(ActionController::ParameterMissing)
end
it "returns no results if the title length is below the minimum" do
Topic.expects(:similar_to).never
SiteSetting.min_title_similar_length = 100
@ -22,14 +18,6 @@ describe SimilarTopicsController do
expect(json["similar_topics"].size).to eq(0)
end
it "returns no results if the body length is below the minimum" do
Topic.expects(:similar_to).never
SiteSetting.min_body_similar_length = 100
xhr :get, :index, title: title, raw: raw
json = ::JSON.parse(response.body)
expect(json["similar_topics"].size).to eq(0)
end
describe "minimum_topics_similar" do
before do