summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/repositories_subversion_controller_test.rb21
-rw-r--r--test/helpers/journals_helper_test.rb6
-rw-r--r--test/system/messages_test.rb4
-rw-r--r--test/unit/lib/redmine/quote_reply_helper_test.rb14
4 files changed, 33 insertions, 12 deletions
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 7de85a78d..0a430317f 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -358,6 +358,27 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
assert_equal "attachment; filename=\"helloworld.c\"; filename*=UTF-8''helloworld.c", @response.headers['Content-Disposition']
end
+ def test_entry_should_return_text_plain_for_js_files
+ # JavaScript files should be served as 'text/plain' instead of
+ # 'application/javascript' to avoid
+ # ActionController::InvalidCrossOriginRequest exception
+ assert_equal 0, @repository.changesets.count
+ @repository.fetch_changesets
+ @project.reload
+ assert_equal NUM_REV, @repository.changesets.count
+ get(
+ :raw,
+ :params => {
+ :id => PRJ_ID,
+ :repository_id => @repository.id,
+ :path => repository_path_hash(['subversion_test', 'foo.js'])[:param]
+ }
+ )
+ assert_response :success
+ assert_equal 'text/plain', @response.media_type
+ assert_match /attachment/, @response.headers['Content-Disposition']
+ end
+
def test_directory_entry
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
diff --git a/test/helpers/journals_helper_test.rb b/test/helpers/journals_helper_test.rb
index 47f7b7749..5c78761ef 100644
--- a/test/helpers/journals_helper_test.rb
+++ b/test/helpers/journals_helper_test.rb
@@ -47,7 +47,7 @@ class JournalsHelperTest < Redmine::HelperTest
journals = issue.visible_journals_with_index # add indice
journal_actions = render_journal_actions(issue, journals.first, {reply_links: true})
- assert_select_in journal_actions, 'a[title=?][class="icon icon-quote"]', 'Quote'
+ assert_select_in journal_actions, 'a[title=?][class="icon-only icon-quote"]', 'Quote'
assert_select_in journal_actions, 'a[title=?][class="icon-only icon-edit"]', 'Edit'
assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-del"]'
assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-copy-link"]'
@@ -66,8 +66,8 @@ class JournalsHelperTest < Redmine::HelperTest
assert_select_in journal_actions, 'span.reaction-button-wrapper'
assert_select_in journal_actions, 'span.drdn'
- assert_select_in journal_actions, 'a[class="icon-comment"]', false
- assert_select_in journal_actions, 'a[class="icon-edit"]', false
+ assert_select_in journal_actions, 'a[class="icon-only icon-quote"]', false
+ assert_select_in journal_actions, 'a[class="icon-only icon-edit"]', false
end
def test_journal_thumbnail_attachments_should_be_in_the_same_order_as_the_journal_details
diff --git a/test/system/messages_test.rb b/test/system/messages_test.rb
index 66a29a3a7..ac074ac1a 100644
--- a/test/system/messages_test.rb
+++ b/test/system/messages_test.rb
@@ -22,7 +22,7 @@ require_relative '../application_system_test_case'
class MessagesTest < ApplicationSystemTestCase
def test_reply_to_topic_message
with_text_formatting 'common_mark' do
- within '#content > .contextual' do
+ within '#content > [data-controller="quote-reply"]' do
click_link 'Quote'
end
@@ -64,7 +64,7 @@ class MessagesTest < ApplicationSystemTestCase
window.getSelection().addRange(range);
JS
- within '#content > .contextual' do
+ within '#content > [data-controller="quote-reply"]' do
click_link 'Quote'
end
diff --git a/test/unit/lib/redmine/quote_reply_helper_test.rb b/test/unit/lib/redmine/quote_reply_helper_test.rb
index cbac1f6d0..d5d13d4f8 100644
--- a/test/unit/lib/redmine/quote_reply_helper_test.rb
+++ b/test/unit/lib/redmine/quote_reply_helper_test.rb
@@ -23,18 +23,18 @@ class QuoteReplyHelperTest < ActionView::TestCase
include ERB::Util
include Redmine::QuoteReply::Helper
- def test_quote_reply
+ def test_quote_reply_button
with_locale 'en' do
url = quoted_issue_path(issues(:issues_001))
- a_tag = quote_reply(url, '#issue_description_wiki')
- assert_includes a_tag, %|onclick="#{h "quoteReply('/issues/1/quoted', '#issue_description_wiki', 'common_mark'); return false;"}"|
- assert_includes a_tag, %|class="icon icon-quote"|
- assert_not_includes a_tag, 'title='
+ html = quote_reply_button(url: url)
+ assert_select_in html,
+ 'a[data-quote-reply-url-param=?][data-quote-reply-text-formatting-param=?]:not([title])',
+ url, Setting.text_formatting
# When icon_only is true
- a_tag = quote_reply(url, '#issue_description_wiki', icon_only: true)
- assert_includes a_tag, %|title="Quote"|
+ html = quote_reply_button(url: url, icon_only: true)
+ assert_select_in html, 'a.icon-only.icon-quote[title=?]', 'Quote'
end
end
end