Skip to content

Commit

Permalink
[api] support limitation to projects for channel search
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jul 22, 2015
1 parent 19e2d00 commit 3459699
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/api/lib/xpath_engine.rb
Expand Up @@ -177,6 +177,11 @@ def initialize
'@name' => {:cpart => 'name'},
'@binaryarch' => {:cpart => 'binaryarch'},
'@package' => {:cpart => 'package'},
'@project' => {:cpart => 'ufdct.disabled', :joins => [
'LEFT join channel_binary_lists cblp on cblp.id=channel_binaries.channel_binary_list_id',
'LEFT join channels cp on cp.id=cblp.channel_id',
'LEFT join packages cpkg on cpkg.id=cp.package_id',
'LEFT join projects cprj on cprj.id=cpkg.project_id']},
'@supportstatus' => {:cpart => 'supportstatus'},
'target/disabled' => {:cpart => 'ufdct.disabled', :joins => [
'LEFT join channel_binary_lists ufdcbl on ufdcbl.id=channel_binaries.channel_binary_list_id',
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/source_controller_test.rb
Expand Up @@ -2889,7 +2889,7 @@ def test_parse_channel_file
assert_match b.repository.name, 'BaseDistro_repo'

# check search interface
get '/search/channel/binary?match=@name="glibc-devel"'
get '/search/channel/binary?match=@project="home:Iggy"+and+@name="glibc-devel"'
assert_response :success
assert_xml_tag tag: "collection", attributes: {matches: "1"}
assert_xml_tag parent: {tag: "channel", attributes: {project: "home:Iggy", package: "TestChannel"}},
Expand Down

0 comments on commit 3459699

Please sign in to comment.