Skip to content

Commit

Permalink
Version 5.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrossello committed Dec 20, 2024
2 parents a61af69 + 1b138b0 commit 6cf5507
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 47 deletions.
6 changes: 3 additions & 3 deletions init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
description 'Allows to run the Redmine test suite along with plugin tests, considering the different behaviors
introduced by supported plugins over the Redmine default behavior.
Unsupported plugins are signaled in the logs.'
version '5.1.4.1'
version '5.1.5'
url 'https://github.com/maxrossello/redmine_testsuites.git'
author_url 'https://github.com/maxrossello'
requires_redmine :version => '5.1.4'
requires_redmine :version => '5.1.5'

end

Expand All @@ -47,7 +47,7 @@
redmine_better_overview: { tilde_greater_than: '5.1.0', mandatory: false },
redmine_extended_watchers: { tilde_greater_than: '5.1.4', mandatory: false },
redmine_pluggable_themes: { tilde_greater_than: '5.1.0', mandatory: false },
redwine: { version: '5.1.4', mandatory: false },
redwine: { version: '5.1.5', mandatory: false },
sidebar_hide: { version_or_higher: '5.1.1', mandatory: false }
}

Expand Down
4 changes: 2 additions & 2 deletions test/functional/account_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def test_get_login
get :login
assert_response :success

assert_select 'input[name=username]'
assert_select 'input[name=password]'
assert_select 'input[name=username][autocomplete=username]'
assert_select 'input[name=password][autocomplete=current-password]'
end

def test_get_login_while_logged_in_should_redirect_to_back_url_if_present
Expand Down
2 changes: 1 addition & 1 deletion test/functional/application_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

# Redmine - project management software
# Copyright (C) 2006- Jean-Philippe Lang
# Copyright (C) 2006-2023 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
6 changes: 3 additions & 3 deletions test/functional/my_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ def test_post_destroy_with_unsubscribe_not_allowed_should_not_destroy_account
def test_change_password
get :password
assert_response :success
assert_select 'input[type=password][name=password]'
assert_select 'input[type=password][name=new_password]'
assert_select 'input[type=password][name=new_password_confirmation]'
assert_select 'input[type=password][name=password][autocomplete=current-password]'
assert_select 'input[type=password][name=new_password][autocomplete=new-password]'
assert_select 'input[type=password][name=new_password_confirmation][autocomplete=new-password]'
end

def test_update_password
Expand Down
2 changes: 1 addition & 1 deletion test/functional/projects_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ProjectsControllerTest < Redmine::ControllerTest
:enabled_modules, :enumerations, :boards, :messages,
:attachments, :custom_fields, :custom_values, :time_entries,
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions,
:roles, :queries
:roles, :queries, :issue_categories

include Redmine::I18n

Expand Down
3 changes: 0 additions & 3 deletions test/helpers/projects_queries_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
class ProjectsQueriesHelperTest < Redmine::HelperTest
include ProjectsQueriesHelper

fixtures :projects, :enabled_modules,
:custom_fields, :custom_values

def test_csv_value
c_status = QueryColumn.new(:status)
c_parent_id = QueryColumn.new(:parent_id)
Expand Down
4 changes: 2 additions & 2 deletions test/integration/account_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def test_lost_password
follow_redirect!
assert_response :success
assert_select 'input[type=hidden][name=token][value=?]', token.value
assert_select 'input[name=new_password]'
assert_select 'input[name=new_password_confirmation]'
assert_select 'input[name=new_password][autocomplete=new-password]'
assert_select 'input[name=new_password_confirmation][autocomplete=new-password]'

post(
"/account/lost_password",
Expand Down
2 changes: 1 addition & 1 deletion test/system/keyboard_shortcuts_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

require_relative '../application_system_test_case'

class InlineAutocompleteSystemTest < ApplicationSystemTestCase
class KeyboardShortcutsTest < ApplicationSystemTestCase
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
:trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues,
:enumerations, :custom_fields, :custom_values, :custom_fields_trackers,
Expand Down
49 changes: 49 additions & 0 deletions test/system/versions_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# frozen_string_literal: true

# Redmine - project management software
# Copyright (C) 2006- Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

require_relative '../application_system_test_case'

class VersionsSystemTest < ApplicationSystemTestCase
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
:trackers, :projects_trackers, :enabled_modules,
:issue_statuses, :issues, :issue_categories,
:enumerations, :versions, :workflows

def test_create_from_issue_form_with_file_custom_field
VersionCustomField.generate!(:field_format => 'attachment')

log_user('jsmith', 'jsmith')

version_name = 'Version with file custom field'

assert_difference 'Version.count' do
visit '/projects/ecookbook/issues/new'
fill_in 'Subject', :with => 'With a new version'

click_on 'New version'
within '#ajax-modal' do
fill_in 'Name', :with => version_name
click_on 'Create'
end
click_on 'Create'
end

assert_equal version_name, Version.last.name
end
end
2 changes: 1 addition & 1 deletion test/unit/issue_nested_set_concurrency_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setup
ActiveRecord::Base.establish_connection connection
end
User.current = nil
CustomField.delete_all
CustomField.destroy_all
end

def teardown
Expand Down
38 changes: 17 additions & 21 deletions test/unit/issue_relation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,30 +202,26 @@ def test_validates_circular_dependency_on_reverse_relations
def test_create_with_initialized_journals_should_create_journals
from = Issue.find(1)
to = Issue.find(2)
from_journals = from.journals.size
to_journals = to.journals.size
relation = IssueRelation.new(:issue_from => from, :issue_to => to,
:relation_type => IssueRelation::TYPE_PRECEDES)
relation.init_journals User.find(1)
assert relation.save
from.reload
to.reload
relation.reload
assert_equal from.journals.size, (from_journals + 1)
assert_equal to.journals.size, (to_journals + 1)
assert_equal 'relation', from.journals.last.details.last.property
assert_equal 'precedes', from.journals.last.details.last.prop_key
assert_equal '2', from.journals.last.details.last.value
assert_nil from.journals.last.details.last.old_value
#assert_equal 'relation', to.journals.last.details.last.property
#assert_equal 'follows', to.journals.last.details.last.prop_key
#assert_equal '1', to.journals.last.details.last.value
#assert_nil to.journals.last.details.last.old_value
assert to.journals.last.details.any? do |detail|
detail.property == 'relation' and
detail.prop_key == 'follows' and
detail.value == '1' and
detail.old_value == nil

assert_difference(
->{ from.reload.journals.size } => +1,
->{ to.reload.journals.size } => +1
) do
assert relation.save
end

from.journals.last.details.then do |details|
assert details.exists?(property: 'relation', prop_key: 'precedes', value: '2')
end

to.journals.last.details.then do |details|
assert_equal 3, details.count
assert details.exists?(property: 'relation', prop_key: 'follows', value: '1', old_value: nil)
assert details.exists?(property: 'attr', prop_key: 'due_date')
assert details.exists?(property: 'attr', prop_key: 'start_date')
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/unit/issue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def test_new_statuses_allowed_to_should_only_return_transitions_of_considered_wo
WorkflowTransition.create!(:role_id => 2, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3)

# status 3 is not displayed
expected_statuses = IssueStatus.where(:id => [1, 2])
expected_statuses = IssueStatus.where(:id => [1, 2]).order(:id)

admin = User.find(1)
assert_equal expected_statuses, issue.new_statuses_allowed_to(admin)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/jobs/destroy_projects_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DestroyProjectsJobTest < ActiveJob::TestCase
fixtures :users, :projects, :email_addresses

setup do
@projects = Project.where(id: [1, 2]).to_a
@projects = Project.where(id: [1, 2]).order(:id).to_a
@user = User.find_by_admin true
ActionMailer::Base.deliveries.clear
end
Expand Down
9 changes: 3 additions & 6 deletions test/unit/lib/redmine/acts/mentionable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ def test_mentioned_users_with_user_mention_having_mail_as_login
def test_mentioned_users_with_multiple_mentions
issue = Issue.generate!(project_id: 1, description: 'Hello @dlopper, @jsmith.')

#assert_equal [User.find(2), User.find(3)], issue.mentioned_users
assert_equal [User.find(2), User.find(3)], issue.mentioned_users.to_a.sort_by(&:id)
assert_equal [User.find(2), User.find(3)], issue.mentioned_users.sort_by(&:id)
end

def test_mentioned_users_should_not_mention_same_user_multiple_times
issue = Issue.generate!(project_id: 1, description: '@dlopper @jsmith @dlopper')

#assert_equal [User.find(2), User.find(3)], issue.mentioned_users
assert_equal [User.find(2), User.find(3)], issue.mentioned_users.to_a.sort_by(&:id)
assert_equal [User.find(2), User.find(3)], issue.mentioned_users.sort_by(&:id)
end

def test_mentioned_users_should_include_only_active_users
Expand Down Expand Up @@ -139,8 +137,7 @@ def test_mentioned_users_should_not_include_users_wrapped_in_pre_tags_for_common
def test_notified_mentions
issue = Issue.generate!(project_id: 1, description: 'Hello @dlopper, @jsmith.')

#assert_equal [User.find(2), User.find(3)], issue.notified_mentions
assert_equal [User.find(2), User.find(3)], issue.notified_mentions.to_a.sort_by(&:id)
assert_equal [User.find(2), User.find(3)], issue.notified_mentions.sort_by(&:id)
end

def test_notified_mentions_should_not_include_users_who_out_of_all_email
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mailer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MailerTest < ActiveSupport::TestCase
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions,
:versions,
:comments,
:groups_users, :watchers
:groups_users, :watchers, :issue_categories

def setup
ActionMailer::Base.deliveries.clear
Expand Down

0 comments on commit 6cf5507

Please sign in to comment.