mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 10:05:52 +02:00
Extract project query for admins to a separate ProjectAdminQuery model (#42352).
Patch by Holger Just (user:hjust). git-svn-id: https://svn.redmine.org/redmine/trunk@23531 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -600,11 +600,11 @@ class QueriesControllerTest < Redmine::ControllerTest
|
||||
def test_create_admin_projects_query_should_redirect_to_admin_projects
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
q = new_record(ProjectQuery) do
|
||||
q = new_record(ProjectAdminQuery) do
|
||||
post(
|
||||
:create,
|
||||
:params => {
|
||||
:type => 'ProjectQuery',
|
||||
:type => 'ProjectAdminQuery',
|
||||
:default_columns => '1',
|
||||
:f => ["status"],
|
||||
:op => {
|
||||
@@ -615,13 +615,12 @@ class QueriesControllerTest < Redmine::ControllerTest
|
||||
},
|
||||
:query => {
|
||||
"name" => "test_new_project_public_query", "visibility" => "2"
|
||||
},
|
||||
:admin_projects => 1
|
||||
}
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
assert_redirected_to :controller => 'admin', :action => 'projects', :query_id => q.id, :admin_projects => 1
|
||||
assert_redirected_to :controller => 'admin', :action => 'projects', :query_id => q.id
|
||||
end
|
||||
|
||||
def test_edit_global_public_query
|
||||
@@ -738,7 +737,7 @@ class QueriesControllerTest < Redmine::ControllerTest
|
||||
end
|
||||
|
||||
def test_update_admin_projects_query
|
||||
q = ProjectQuery.create(:name => 'project_query')
|
||||
q = ProjectAdminQuery.create(:name => 'project_query')
|
||||
@request.session[:user_id] = 1
|
||||
|
||||
put(
|
||||
@@ -755,12 +754,11 @@ class QueriesControllerTest < Redmine::ControllerTest
|
||||
},
|
||||
:query => {
|
||||
"name" => "test_project_query_updated", "visibility" => "2"
|
||||
},
|
||||
:admin_projects => 1
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
assert_redirected_to :controller => 'admin', :action => 'projects', :query_id => q.id, :admin_projects => 1
|
||||
assert_redirected_to :controller => 'admin', :action => 'projects', :query_id => q.id
|
||||
assert Query.find_by_name('test_project_query_updated')
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user