#1434 duplicited code
This commit is contained in:
parent
2b73e59c8f
commit
969e76e0f7
2
.github/workflows/rubyonrails.yml
vendored
2
.github/workflows/rubyonrails.yml
vendored
@ -127,7 +127,7 @@ jobs:
|
||||
cp /opt/redmine/config/additional_environment.rb.example /opt/redmine/config/additional_environment.rb
|
||||
echo "config.log_level = :info" >> /opt/redmine/config/additional_environment.rb
|
||||
echo "# Redmine DMSF's WebDAV" >> /opt/redmine/config/additional_environment.rb
|
||||
echo "require File.dirname(__FILE__) + '/plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware'" >> /opt/redmine/config/additional_environment.rb
|
||||
echo "require 'plugins/redmine_dmsf/lib/redmine_dmsf/webdav/custom_middleware'" >> /opt/redmine/config/additional_environment.rb
|
||||
echo "config.middleware.insert_before ActionDispatch::Cookies, RedmineDmsf::Webdav::CustomMiddleware" >> /opt/redmine/config/additional_environment.rb
|
||||
- name: Standard tests
|
||||
# Run the tests
|
||||
|
||||
@ -43,9 +43,6 @@ module RedmineDmsf
|
||||
raise ActiveRecord::RecordNotFound
|
||||
end
|
||||
end
|
||||
unless User.current&.allowed_to?(:view_dmsf_files, file.project, { id: file.id })
|
||||
raise l(:notice_not_authorized)
|
||||
end
|
||||
title = args[1].present? ? args[1] : file.title
|
||||
title.gsub! /\A"|"\z/, '' # Remove apostrophes
|
||||
title.gsub! /\A'|'\z/, ''
|
||||
|
||||
@ -79,9 +79,11 @@ class DmsfFilesControllerTest < RedmineDmsf::Test::TestCase
|
||||
|
||||
def test_view_preview
|
||||
get :view, params: { id: @file13.id }
|
||||
assert_response :success
|
||||
assert_equal 'application/pdf', @response.media_type
|
||||
assert @response.body.starts_with?('%PDF')
|
||||
if RedmineDmsf::Preview.office_available?
|
||||
assert_response :success
|
||||
assert_equal 'application/pdf', @response.media_type
|
||||
assert @response.body.starts_with?('%PDF')
|
||||
end
|
||||
end
|
||||
|
||||
def delete_forbidden
|
||||
|
||||
@ -80,8 +80,10 @@ class MyControllerTest < RedmineDmsf::Test::TestCase
|
||||
@project1.add_watcher @jsmith
|
||||
get :page
|
||||
assert_response :success
|
||||
assert_select 'div#list-top' do
|
||||
assert_select 'h3', { text: "#{l(:label_dmsf_watched)} (2/1)" }
|
||||
unless defined?(EasyExtensions)
|
||||
assert_select 'div#list-top' do
|
||||
assert_select 'h3', { text: "#{l(:label_dmsf_watched)} (2/1)" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user