Commit 410d0ef3ce548248dad083ed20c13f5ada7319bb
1 parent
dd9fce48
Exists in
master
and in
5 other branches
Fix Internacionalizable search and test
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Singed-off-by: Gustavo jaruga <darksshades@gmail.com>
Showing
2 changed files
with
16 additions
and
1 deletions
Show diff stats
lib/software_info.rb
| @@ -55,7 +55,7 @@ class SoftwareInfo < ActiveRecord::Base | @@ -55,7 +55,7 @@ class SoftwareInfo < ActiveRecord::Base | ||
| 55 | end | 55 | end |
| 56 | 56 | ||
| 57 | unless internacionalizable.blank? | 57 | unless internacionalizable.blank? |
| 58 | - like_sql << "internacionalizable = ? AND " | 58 | + like_sql << "intern = ? AND " |
| 59 | values << "#{internacionalizable}" | 59 | values << "#{internacionalizable}" |
| 60 | end | 60 | end |
| 61 | 61 |
test/functional/search_controller_test.rb
| @@ -241,6 +241,21 @@ class SearchControllerTest < ActionController::TestCase | @@ -241,6 +241,21 @@ class SearchControllerTest < ActionController::TestCase | ||
| 241 | assert_includes assigns(:searches)[:communities][:results], software.community | 241 | assert_includes assigns(:searches)[:communities][:results], software.community |
| 242 | end | 242 | end |
| 243 | 243 | ||
| 244 | + should "search for software by internacionalizable" do | ||
| 245 | + software = create_software("beautiful") | ||
| 246 | + software.intern = true | ||
| 247 | + software.save! | ||
| 248 | + | ||
| 249 | + params = {"type"=>"Software", "query"=>"", "name"=>"", "database_description"=>{"id"=>""}, | ||
| 250 | + "programming_language"=>{"id"=>""}, | ||
| 251 | + "operating_system"=>{"id"=>""}, | ||
| 252 | + "controlled_vocabulary"=>"", "license_info"=>{"id"=>""}, "e_ping"=>"", "e_mag"=>"", "icp_brasil"=>"", "e_arq"=>"", "internacionalizable"=>"true", | ||
| 253 | + "commit"=>"Search"} | ||
| 254 | + get :communities, params | ||
| 255 | + | ||
| 256 | + assert_includes assigns(:searches)[:communities][:results], software.community | ||
| 257 | + end | ||
| 258 | + | ||
| 244 | should "search by e_arq and e_ping" do | 259 | should "search by e_arq and e_ping" do |
| 245 | software = create_software("beautiful") | 260 | software = create_software("beautiful") |
| 246 | software.e_arq = true | 261 | software.e_arq = true |