Defect #28264 » tests_for_28264.patch
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
assert_equal 1, session[:issue_query][:project_id]
|
||
|
end
|
||
|
def test_index_with_global_public_query_id_should_not_show_edit_delete_links_for_non_admin_users
|
||
|
@request.session[:user_id] = 2
|
||
|
get :index, :params => {
|
||
|
:project_id => 1,
|
||
|
:query_id => 4
|
||
|
}
|
||
|
assert_response :success
|
||
|
assert_select '#query_form_with_buttons > p.buttons' do
|
||
|
assert_select 'a.icon-edit', 0
|
||
|
assert_select 'a.icon-delete', 0
|
||
|
end
|
||
|
end
|
||
|
def test_index_with_invalid_query_id_should_respond_404
|
||
|
get :index, :params => {
|
||
|
:project_id => 1,
|
||
| test/functional/queries_controller_test.rb | ||
|---|---|---|
|
assert_select 'input[name=query_is_for_all][type=checkbox][checked=checked]'
|
||
|
end
|
||
|
def test_edit_global_public_query_should_not_be_allowed_for_non_admin_users
|
||
|
@request.session[:user_id] = 2
|
||
|
get :edit, :params => {
|
||
|
:id => 4
|
||
|
}
|
||
|
assert_response 403
|
||
|
end
|
||
|
def test_edit_global_private_query
|
||
|
@request.session[:user_id] = 3
|
||
|
get :edit, :params => {
|
||