1030 |
1030 |
assert_include ["Development", "10"], json
|
1031 |
1031 |
assert_include ["Inactive Activity", "14"], json
|
1032 |
1032 |
end
|
|
1033 |
|
|
1034 |
def test_new_query_is_for_all_checkbox_not_disabled
|
|
1035 |
@request.session[:user_id] = 1
|
|
1036 |
get :new
|
|
1037 |
assert_response :success
|
|
1038 |
# Verify that the "For all projects" checkbox is not disabled when creating a new query
|
|
1039 |
assert_select 'input[name=query_is_for_all][type=checkbox][checked]:not([disabled])'
|
|
1040 |
end
|
|
1041 |
|
|
1042 |
def test_new_project_query_is_for_all_checkbox_not_disabled
|
|
1043 |
@request.session[:user_id] = 1
|
|
1044 |
get(:new, :params => {:project_id => 1})
|
|
1045 |
assert_response :success
|
|
1046 |
# Verify that the checkbox is not disabled when creating a new query within a project
|
|
1047 |
assert_select 'input[name=query_is_for_all][type=checkbox]:not([checked]):not([disabled])'
|
|
1048 |
end
|
|
1049 |
|
|
1050 |
def test_edit_global_query_is_for_all_checkbox_disabled
|
|
1051 |
@request.session[:user_id] = 1
|
|
1052 |
# Create a global query (project_id = nil)
|
|
1053 |
query = IssueQuery.create!(:name => 'test_global_query', :user_id => 1, :project_id => nil)
|
|
1054 |
|
|
1055 |
get(:edit, :params => {:id => query.id})
|
|
1056 |
assert_response :success
|
|
1057 |
|
|
1058 |
# Verify that the "For all projects" checkbox is disabled when editing an existing global query
|
|
1059 |
assert_select 'input[name=query_is_for_all][type=checkbox][checked][disabled]'
|
|
1060 |
end
|
|
1061 |
|
|
1062 |
def test_edit_project_query_is_for_all_checkbox_not_disabled
|
|
1063 |
@request.session[:user_id] = 1
|
|
1064 |
# Create a project-specific query
|
|
1065 |
query = IssueQuery.create!(:name => 'test_project_query', :user_id => 1, :project_id => 1)
|
|
1066 |
|
|
1067 |
get(:edit, :params => {:id => query.id})
|
|
1068 |
assert_response :success
|
|
1069 |
|
|
1070 |
# Verify that the checkbox is not disabled when editing a project-specific query
|
|
1071 |
assert_select 'input[name=query_is_for_all][type=checkbox]:not([checked]):not([disabled])'
|
|
1072 |
end
|
1033 |
1073 |
end
|