Add feature test on force delete #2845

This commit is contained in:
Martin Lensment 2015-08-11 11:41:55 +03:00
parent aa54e3c84f
commit 394f30255f
2 changed files with 35 additions and 1 deletions

View file

@ -18,7 +18,7 @@ class Admin::DomainsController < AdminController
normalize_search_parameters do
@q = domains.search(params[:q])
@domains = @q.result.page(params[:page])
if @domains.count == 1
if @domains.count == 1 && params[:q][:name_matches].present?
redirect_to [:admin, @domains.first] and return
elsif @domains.count == 0 && params[:q][:name_matches] !~ /^%.+%$/
# if we do not get any results, add wildcards to the name field and search again