diff --git a/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results.yml b/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results.yml
new file mode 100644
index 00000000000..90f16f85cff
--- /dev/null
+++ b/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results.yml
@@ -0,0 +1,239 @@
+---
+http_interactions:
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy2/_meta?user=Iggy2
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '133'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/_meta?user=DevelIggy
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '141'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/DevelPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '111'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: post
+ uri: http://localhost:3200/search/published/binary/id?match=(@name='package'%20and%20(@project='home:Iggy'))
+ body:
+ encoding: UTF-8
+ string: ''
+ headers:
+ Content-Type:
+ - application/octet-stream
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '531'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+recorded_with: VCR 3.0.1
diff --git a/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results_for_devel_package.yml b/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results_for_devel_package.yml
new file mode 100644
index 00000000000..35935b2e0fa
--- /dev/null
+++ b/src/api/spec/cassettes/Webui_SearchController/GET_owner/assigns_results_for_devel_package.yml
@@ -0,0 +1,280 @@
+---
+http_interactions:
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy2/_meta?user=Iggy2
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '133'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/_meta?user=DevelIggy
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '141'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/DevelPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '111'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '162'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: post
+ uri: http://localhost:3200/search/published/binary/id?match=(@name='package'%20and%20(@project='home:Iggy'))
+ body:
+ encoding: UTF-8
+ string: ''
+ headers:
+ Content-Type:
+ - application/octet-stream
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '531'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+recorded_with: VCR 3.0.1
diff --git a/src/api/spec/cassettes/Webui_SearchController/GET_owner/just_returns_with_blank_search_text.yml b/src/api/spec/cassettes/Webui_SearchController/GET_owner/just_returns_with_blank_search_text.yml
new file mode 100644
index 00000000000..5482e6d53ea
--- /dev/null
+++ b/src/api/spec/cassettes/Webui_SearchController/GET_owner/just_returns_with_blank_search_text.yml
@@ -0,0 +1,202 @@
+---
+http_interactions:
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy2/_meta?user=Iggy2
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '133'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/_meta?user=DevelIggy
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '141'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:19 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/DevelPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '111'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+recorded_with: VCR 3.0.1
diff --git a/src/api/spec/cassettes/Webui_SearchController/GET_owner/warns_about_short_search_text.yml b/src/api/spec/cassettes/Webui_SearchController/GET_owner/warns_about_short_search_text.yml
new file mode 100644
index 00000000000..927316aa042
--- /dev/null
+++ b/src/api/spec/cassettes/Webui_SearchController/GET_owner/warns_about_short_search_text.yml
@@ -0,0 +1,202 @@
+---
+http_interactions:
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy2/_meta?user=Iggy2
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '133'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/_meta?user=DevelIggy
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '141'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:Iggy/TestPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '105'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+- request:
+ method: put
+ uri: http://localhost:3200/source/home:DevelIggy/DevelPack/_meta?user=_nobody_
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ headers:
+ Accept-Encoding:
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+ Accept:
+ - "*/*"
+ User-Agent:
+ - Ruby
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Content-Type:
+ - text/xml
+ Cache-Control:
+ - no-cache
+ Connection:
+ - close
+ Content-Length:
+ - '111'
+ body:
+ encoding: UTF-8
+ string: |
+
+
+
+
+ http_version:
+ recorded_at: Fri, 15 Jul 2016 11:52:20 GMT
+recorded_with: VCR 3.0.1
diff --git a/src/api/spec/controllers/webui/search_controller_spec.rb b/src/api/spec/controllers/webui/search_controller_spec.rb
new file mode 100644
index 00000000000..855e291761f
--- /dev/null
+++ b/src/api/spec/controllers/webui/search_controller_spec.rb
@@ -0,0 +1,38 @@
+require 'rails_helper'
+# WARNING: If you change owner tests make sure you uncomment this line
+# and start a test backend. Some of the Owner methods
+# require real backend answers for projects/packages.
+# CONFIG['global_write_through'] = true
+
+RSpec.describe Webui::SearchController, vcr: true do
+ let!(:user) { create(:confirmed_user, login: 'Iggy') }
+ let!(:develuser) { create(:confirmed_user, login: 'DevelIggy') }
+ let!(:package) { create(:package, name: 'TestPack', project: Project.find_by(name: 'home:Iggy')) }
+ let!(:develpackage) { create(:package, name: 'DevelPack', project: Project.find_by(name: 'home:DevelIggy')) }
+ let!(:owner_attrib) { create(:attrib, attrib_type: AttribType.where(name: "OwnerRootProject").first, project: Project.find_by(name: 'home:Iggy')) }
+
+ describe "GET #owner" do
+ it 'just returns with blank search text' do
+ get(:owner, { search_text: '', owner: 1 })
+ expect(response).to have_http_status(:success)
+ end
+
+ it 'warns about short search text' do
+ get(:owner, { search_text: 'a', owner: 1 })
+ expect(controller).to set_flash[:error].to("Search string must contain at least two characters.")
+ end
+
+ it 'assigns results' do
+ get(:owner, { search_text: 'package', owner: 1 })
+ expect(assigns(:results)[0].users).to eq({"maintainer"=>["Iggy"]})
+ end
+
+ it 'assigns results for devel package' do
+ package.update_attributes(develpackage: develpackage)
+
+ get(:owner, { search_text: 'package', owner: 1, devel: 'on' })
+ expect(assigns(:results)[0].users).to eq({"maintainer"=>["DevelIggy"]})
+ expect(assigns(:results)[0].users).not_to eq({"maintainer"=>["Iggy"]})
+ end
+ end
+end
diff --git a/src/api/test/functional/webui/owner_search_test.rb b/src/api/test/functional/webui/owner_search_test.rb
index ef3bca05a6d..a899ec3acdd 100644
--- a/src/api/test/functional/webui/owner_search_test.rb
+++ b/src/api/test/functional/webui/owner_search_test.rb
@@ -53,12 +53,12 @@ def search_results
end
end
- def test_empty_owner_search
+ def test_empty_owner_search # spec/controllers/webui/search_controller_spec.rb
visit_owner_search
search text: "does_not_exist", expect: :no_results
end
- def test_basic_owner_search
+ def test_basic_owner_search # spec/controllers/webui/search_controller_spec.rb
run_publisher
visit_owner_search
search text: "package", expect: "success"
@@ -72,7 +72,7 @@ def test_basic_owner_search
assert_not result[:owners].include? "test_group_empty as maintainer"
end
- def test_owner_search_with_devel
+ def test_owner_search_with_devel # spec/controllers/webui/search_controller_spec.rb
run_publisher
use_js