#1386 tests
This commit is contained in:
parent
405d884ba1
commit
757b9aa4fb
@ -517,6 +517,7 @@ class DmsfQuery < Query
|
||||
end
|
||||
|
||||
# Project's default
|
||||
project = project[:project] if project&.is_a?(Hash)
|
||||
query = project&.default_dmsf_query
|
||||
return query if query&.visibility == VISIBILITY_PUBLIC
|
||||
|
||||
|
||||
@ -58,15 +58,15 @@
|
||||
[l(:label_attachment_plural), Project::ATTACHABLE_ATTACHMENTS],
|
||||
], selected: @project.dmsf_act_as_attachable) %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, "#{l(:label_default_query)}:") %>
|
||||
<% options = [[l(:label_none), nil]] %>
|
||||
<% options.concat DmsfQuery.only_public.where(project_id: nil).pluck(:name, :id) %>
|
||||
<%= select_tag 'default_dmsf_query',
|
||||
options_for_select(options, selected: @project.default_dmsf_query_id) %>
|
||||
<em class="info"><%= l('text_allowed_queries_to_select') %></em>
|
||||
</p>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= content_tag(:label, "#{l(:label_default_query)}:") %>
|
||||
<% options = [[l(:label_none), nil]] %>
|
||||
<% options.concat DmsfQuery.only_public.where(project_id: nil).pluck(:name, :id) %>
|
||||
<%= select_tag 'default_dmsf_query',
|
||||
options_for_select(options, selected: @project.default_dmsf_query_id) %>
|
||||
<em class="info"><%= l('text_allowed_queries_to_select') %></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-actions">
|
||||
|
||||
@ -56,7 +56,17 @@ class ProjectsControllerTest < RedmineDmsf::Test::TestCase
|
||||
@role_manager.add_permission! :user_preferences
|
||||
get :settings, params: { id: @project1.id, tab: 'dmsf' }
|
||||
assert_response :success
|
||||
assert_select 'fieldset legend', text: "#{l(:field_project)} #{l(:label_preferences)}", count: 0
|
||||
assert_select 'label', text: l(:label_act_as_attachable), count: 0
|
||||
end
|
||||
|
||||
def test_legacy_notifications
|
||||
@request.session[:user_id] = @jsmith.id
|
||||
@role_manager.add_permission! :user_preferences
|
||||
with_settings notified_events: ['dmsf_legacy_notifications'] do
|
||||
get :settings, params: { id: @project1.id, tab: 'dmsf' }
|
||||
assert_response :success
|
||||
assert_select 'label', text: l(:label_notifications)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user