FIX: case sensitive unconditional add of exact match in user search

This commit is contained in:
Sam 2017-05-01 14:37:16 -04:00
parent a5fc51a967
commit 556ef4cfbd
4 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,10 @@ import userSearch from 'discourse/lib/user-search';
import { findRawTemplate } from 'discourse/lib/raw-templates';
export default TextField.extend({
autocorrect: false,
autocapitalize: false,
name: 'user-selector',
@observes('usernames')
_update() {
if (this.get('canReceiveUpdates') === 'true')

View File

@ -61,7 +61,7 @@ function organizeResults(r, options) {
if (r.groups) {
r.groups.every(function(g) {
if (results.length > limit && options.term !== g.name) return false;
if (results.length > limit && options.term.toLowerCase() !== g.name.toLowerCase()) return false;
if (exclude.indexOf(g.name) === -1) {
groups.push(g);
results.push(g);

View File

@ -145,7 +145,7 @@ class Autospec::Manager
# try focus tag
if failed_specs.length > 0
filename,_ = failed_specs[0].split(":")
if filename && File.exist?(filename)
if filename && File.exist?(filename) && !File.directory?(filename)
spec = File.read(filename)
start,_ = spec.split(/\S*#focus\S*$/)
if start.length < spec.length

View File

@ -58,7 +58,7 @@ module("lib:user-search", {
});
test("it places groups unconditionally for exact match", function() {
return userSearch({term: 'team'}).then((results)=>{
return userSearch({term: 'Team'}).then((results)=>{
equal(results[results.length-1]["name"], "team");
});
});