Large diffs are not rendered by default.

@@ -53,11 +53,11 @@ def test_tags
assert_equal "Invalid tag 42", flash[:error]
assert_response 302

get_html "/admin/move_tag", :id => 1
get_html "/admin/move_tag/1"
assert_response 302
assert_equal "No such tag 1", flash[:note]

get_html "/admin/move_tag", :id => 462
get_html "/admin/move_tag/462"
assert_response 302
assert_equal "Tag was successfully moved.", flash[:note]

@@ -61,45 +61,45 @@ def test_get_issue_for_patchinfo_and_project

def test_search_issues
reset_auth
get "/search/package_id", :match => 'issue/@name="123456"'
get "/search/package/id", :match => 'issue/@name="123456"'
assert_response 401
get "/search/package_id", :match => 'issue/@tracker="bnc"'
get "/search/package/id", :match => 'issue/@tracker="bnc"'
assert_response 401
get "/search/package_id", :match => 'issue/[@name="123456" and @tracker="bnc"]'
get "/search/package/id", :match => 'issue/[@name="123456" and @tracker="bnc"]'
assert_response 401
get "/search/package_id", :match => 'issue/owner/@login="fred"'
get "/search/package/id", :match => 'issue/owner/@login="fred"'
assert_response 401
get "/search/package_id", :match => 'issue/@state="RESOLVED"'
get "/search/package/id", :match => 'issue/@state="RESOLVED"'
assert_response 401

# search via bug owner
prepare_request_with_user "Iggy", "asdfasdf"
# running patchinfo search as done by webui
get "/search/package_id", :match => '[issue/[@state="CLOSED" and owner/@login="fred"] and kind="patchinfo"]'
get "/search/package/id", :match => '[issue/[@state="CLOSED" and owner/@login="fred"] and kind="patchinfo"]'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }

get "/search/package_id", :match => 'issue/owner/@login="fred"'
get "/search/package/id", :match => 'issue/owner/@login="fred"'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }

# search for specific issue state, issue is in RESOLVED state actually
get "/search/package_id", :match => 'issue/@state="OPEN"'
get "/search/package/id", :match => 'issue/@state="OPEN"'
assert_response :success
assert_no_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }

# running patchinfo search as done by webui
get "/search/package_id", :match => '[kind="patchinfo" and issue/[@state="CLOSED" and owner/@login="fred"]]'
get "/search/package/id", :match => '[kind="patchinfo" and issue/[@state="CLOSED" and owner/@login="fred"]]'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }

# test with not matching kind to verify that it does not match
get "/search/package_id", :match => '[issue/[@state="CLOSED" and owner/@login="fred"] and kind="aggregate"]'
get "/search/package/id", :match => '[issue/[@state="CLOSED" and owner/@login="fred"] and kind="aggregate"]'
assert_response :success
assert_no_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }

# search via bug issue id
get "/search/package_id", :match => '[issue/[@name="123456" and @tracker="bnc"]]'
get "/search/package/id", :match => '[issue/[@name="123456" and @tracker="bnc"]]'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'Devel:BaseDistro:Update', :name => 'pack3' }
end
@@ -186,15 +186,15 @@ def test_get_issue_for_linked_packages
assert_response :success
assert_xml_tag :parent => { :tag => 'issue', :attributes => {:change => 'added'}}, :tag => 'name', :content => "123456"

get "/search/package_id", :match => '[issue/[@name="123456" and @tracker="bnc" and @change="added"]]'
get "/search/package/id", :match => '[issue/[@name="123456" and @tracker="bnc" and @change="added"]]'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'home:Iggy:branches:BaseDistro', :name => 'pack_new' }

get "/search/package_id", :match => '[issue/[@name="123456" and @tracker="bnc" and (@change="added" or @change="changed")]]'
get "/search/package/id", :match => '[issue/[@name="123456" and @tracker="bnc" and (@change="added" or @change="changed")]]'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'home:Iggy:branches:BaseDistro', :name => 'pack_new' }

get "/search/package_id", :match => '[issue/[@name="123456" and @tracker="bnc" and @change="kept"]]'
get "/search/package/id", :match => '[issue/[@name="123456" and @tracker="bnc" and @change="kept"]]'
assert_response :success
assert_no_xml_tag :parent => { :tag => "collection" }, :tag => "package", :attributes => { :project => 'home:Iggy:branches:BaseDistro', :name => 'pack_new' }

@@ -172,7 +172,7 @@ def test_search_issues

def test_search_repository_id
prepare_request_with_user "Iggy", "asdfasdf"
get "/search/repository_id"
get "/search/repository/id"
assert_response :success
assert_xml_tag :tag => 'collection'
repos = get_repos
@@ -182,7 +182,7 @@ def test_search_repository_id
end

prepare_request_with_user "king", "sunflower"
get "/search/repository_id"
get "/search/repository/id"
assert_response :success
assert_xml_tag :tag => 'collection'
repos = get_repos
@@ -1345,16 +1345,16 @@ def test_add_file_to_package
assertresp3, asserteq3, assertresp4)
# write without permission:
prepare_request_with_user "tom", "thunder"
get url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :file => "my_patch.diff")
get url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :filename => "my_patch.diff")
assert_response :success
origstring = @response.body.to_s
teststring = "&;"
put url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :file => "my_patch.diff"), teststring
put url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :filename => "my_patch.diff"), teststring
assert_response( 403, message="Was able to write a package file without permission" )
assert_xml_tag( :tag => "status" )

# check that content is unchanged:
get url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :file => "my_patch.diff")
get url_for(:controller => :source, :action => :file, :project => "kde4", :package => "kdelibs", :filename => "my_patch.diff")
assert_response :success
assert_equal( @response.body.to_s, origstring, message="Package file was changed without permissions" )