Compare commits

..

1 Commits
0.6.3 ... 0.6.1

Author SHA1 Message Date
Jean-Philippe Lang
4b980efd4b tagged version 0.6.1
git-svn-id: http://redmine.rubyforge.org/svn/tags/0.6.1@978 e93f8b46-1217-0410-a6f0-8f06a7374b81
2007-12-11 17:48:08 +00:00
84 changed files with 240 additions and 1418 deletions

View File

@@ -48,7 +48,7 @@ class AdminController < ApplicationController
def mail_options
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
if request.post?
settings = (params[:settings] || {}).dup.symbolize_keys
settings = (params[:settings] || {}).dup
settings[:notified_events] ||= []
settings.each { |name, value| Setting[name] = value }
flash[:notice] = l(:notice_successful_update)

View File

@@ -144,19 +144,6 @@ class ApplicationController < ActionController::Base
def accept_key_auth_actions
self.class.read_inheritable_attribute('accept_key_auth_actions') || []
end
# TODO: move to model
def attach_files(obj, files)
attachments = []
if files && files.is_a?(Array)
files.each do |file|
next unless file.size > 0
a = Attachment.create(:container => obj, :file => file, :author => User.current)
attachments << a unless a.new_record?
end
end
attachments
end
# qvalues http header parser
# code taken from webrick

View File

@@ -45,8 +45,14 @@ class DocumentsController < ApplicationController
end
def add_attachment
attachments = attach_files(@document, params[:attachments])
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('document_added')
# Save the attachments
@attachments = []
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @document, :file => file, :author => User.current)
@attachments << a unless a.new_record?
} if params[:attachments] and params[:attachments].is_a? Array
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('document_added')
redirect_to :action => 'show', :id => @document
end

View File

@@ -91,7 +91,6 @@ class IssuesController < ApplicationController
def edit
@priorities = Enumeration::get_values('IPRI')
@custom_values = []
if request.get?
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
else
@@ -116,8 +115,13 @@ class IssuesController < ApplicationController
def add_note
journal = @issue.init_journal(User.current, params[:notes])
attachments = attach_files(@issue, params[:attachments])
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @issue, :file => file, :author => User.current)
journal.details << JournalDetail.new(:property => 'attachment',
:prop_key => a.id,
:value => a.filename) unless a.new_record?
} if params[:attachments] and params[:attachments].is_a? Array
if journal.save
flash[:notice] = l(:notice_successful_update)
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
@@ -135,8 +139,15 @@ class IssuesController < ApplicationController
journal = @issue.init_journal(User.current, params[:notes])
@issue.status = @new_status
if @issue.update_attributes(params[:issue])
attachments = attach_files(@issue, params[:attachments])
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
# Save attachments
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @issue, :file => file, :author => User.current)
journal.details << JournalDetail.new(:property => 'attachment',
:prop_key => a.id,
:value => a.filename) unless a.new_record?
} if params[:attachments] and params[:attachments].is_a? Array
# Log time
if current_role.allowed_to?(:log_time)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)

View File

@@ -42,7 +42,9 @@ class MessagesController < ApplicationController
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.save
attach_files(@message, params[:attachments])
params[:attachments].each { |file|
Attachment.create(:container => @message, :file => file, :author => User.current) if file.size > 0
} if params[:attachments] and params[:attachments].is_a? Array
redirect_to :action => 'show', :id => @message
end
end
@@ -54,7 +56,9 @@ class MessagesController < ApplicationController
@reply.board = @board
@topic.children << @reply
if !@reply.new_record?
attach_files(@reply, params[:attachments])
params[:attachments].each { |file|
Attachment.create(:container => @reply, :file => file, :author => User.current) if file.size > 0
} if params[:attachments] and params[:attachments].is_a? Array
end
redirect_to :action => 'show', :id => @topic
end
@@ -66,7 +70,9 @@ class MessagesController < ApplicationController
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.update_attributes(params[:message])
attach_files(@message, params[:attachments])
params[:attachments].each { |file|
Attachment.create(:container => @message, :file => file, :author => User.current) if file.size > 0
} if params[:attachments] and params[:attachments].is_a? Array
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'show', :id => @topic
end

View File

@@ -181,7 +181,10 @@ class ProjectsController < ApplicationController
def add_document
@document = @project.documents.build(params[:document])
if request.post? and @document.save
attach_files(@document, params[:attachments])
# Save the attachments
params[:attachments].each { |a|
Attachment.create(:container => @document, :file => a, :author => User.current) unless a.size == 0
} if params[:attachments] and params[:attachments].is_a? Array
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
redirect_to :action => 'list_documents', :id => @project
@@ -234,7 +237,10 @@ class ProjectsController < ApplicationController
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
@issue.custom_values = @custom_values
if @issue.save
attach_files(@issue, params[:attachments])
if params[:attachments] && params[:attachments].is_a?(Array)
# Save attachments
params[:attachments].each {|a| Attachment.create(:container => @issue, :file => a, :author => User.current) unless a.size == 0}
end
flash[:notice] = l(:notice_successful_create)
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
@@ -339,8 +345,14 @@ class ProjectsController < ApplicationController
def add_file
if request.post?
@version = @project.versions.find_by_id(params[:version_id])
attachments = attach_files(@version, params[:attachments])
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
# Save the attachments
@attachments = []
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @version, :file => file, :author => User.current)
@attachments << a unless a.new_record?
} if params[:attachments] and params[:attachments].is_a? Array
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('file_added')
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
end
@versions = @project.versions.sort

View File

@@ -92,9 +92,6 @@ class RepositoriesController < ApplicationController
show_error and return unless @content
if 'raw' == params[:format]
send_data @content, :filename => @path.split('/').last
else
# Prevent empty lines when displaying a file with Windows style eol
@content.gsub!("\r\n", "\n")
end
end

View File

@@ -109,4 +109,12 @@ class UsersController < ApplicationController
end
redirect_to :action => 'edit', :id => @user and return
end
def destroy
User.find(params[:id]).destroy
redirect_to :action => 'list'
rescue
flash[:error] = "Unable to delete user"
redirect_to :action => 'list'
end
end

View File

@@ -154,7 +154,11 @@ class WikiController < ApplicationController
def add_attachment
@page = @wiki.find_page(params[:page])
attach_files(@page, params[:attachments])
# Save the attachments
params[:attachments].each { |file|
next unless file.size > 0
a = Attachment.create(:container => @page, :file => file, :author => User.current)
} if params[:attachments] and params[:attachments].is_a? Array
redirect_to :action => 'index', :page => @page.title
end

View File

@@ -23,7 +23,7 @@ class WikisController < ApplicationController
def edit
@wiki = @project.wiki || Wiki.new(:project => @project)
@wiki.attributes = params[:wiki]
@wiki.save if request.post?
@wiki.save if @request.post?
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
end

View File

@@ -179,9 +179,9 @@ module ProjectsHelper
end
# today red line
if Date.today >= date_from and Date.today <= date_to
if Date.today >= @date_from and Date.today <= @date_to
gc.stroke('red')
x = (Date.today-date_from+1)*zoom + subject_width
x = (Date.today-@date_from+1)*zoom + subject_width
gc.line(x, headers_heigth, x, headers_heigth + g_height-1)
end

View File

@@ -20,8 +20,7 @@ class AuthSource < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
validates_length_of :name, :host, :maximum => 60
validates_length_of :account_password, :maximum => 60, :allow_nil => true
validates_length_of :name, :host, :account_password, :maximum => 60
validates_length_of :account, :base_dn, :maximum => 255
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30

View File

@@ -43,9 +43,6 @@ class CustomField < ActiveRecord::Base
def before_validation
# remove empty values
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
# make sure these fields are not searchable
self.searchable = false if %w(int float date bool).include?(field_format)
true
end
def validate

View File

@@ -79,8 +79,7 @@ class Project < ActiveRecord::Base
conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
end
conditions ||= ["#{Issue.table_name}.project_id = ?", id]
# Quick and dirty fix for Rails 2 compatibility
Issue.send(:with_scope, :find => { :conditions => conditions }) do
Issue.with_scope :find => { :conditions => conditions } do
yield
end
end

View File

@@ -54,6 +54,7 @@ class Query < ActiveRecord::Base
serialize :column_names
attr_protected :project, :user
attr_accessor :executed_by
validates_presence_of :name, :on => :save
validates_length_of :name, :maximum => 255
@@ -111,7 +112,8 @@ class Query < ActiveRecord::Base
def initialize(attributes = nil)
super attributes
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
set_language_if_valid(User.current.language)
@executed_by = User.current.logged? ? User.current : nil
set_language_if_valid(executed_by.language) if executed_by
end
def validate
@@ -143,12 +145,12 @@ class Query < ActiveRecord::Base
"done_ratio" => { :type => :integer, :order => 13 }}
user_values = []
user_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
user_values << ["<< #{l(:label_me)} >>", "me"] if executed_by
if project
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
else
elsif executed_by
# members of the user's projects
user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
user_values += executed_by.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
end
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?
@available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } unless user_values.empty?
@@ -265,7 +267,7 @@ class Query < ActiveRecord::Base
elsif project
clause << "#{Issue.table_name}.project_id=%d" % project.id
else
clause << Project.visible_by(User.current)
clause << Project.visible_by(executed_by)
end
# filters clauses
@@ -290,7 +292,7 @@ class Query < ActiveRecord::Base
# "me" value subsitution
if %w(assigned_to_id author_id).include?(field)
v.push(User.current.logged? ? User.current.id.to_s : "0") if v.delete("me")
v.push(executed_by ? executed_by.id.to_s : "0") if v.delete("me")
end
case operator_for field

View File

@@ -25,8 +25,8 @@ class WikiContent < ActiveRecord::Base
acts_as_versioned
class Version
belongs_to :page, :class_name => '::WikiPage', :foreign_key => 'page_id'
belongs_to :author, :class_name => '::User', :foreign_key => 'author_id'
belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
attr_protected :data
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},

View File

@@ -7,32 +7,21 @@ function toggle_custom_field_format() {
p_length = $("custom_field_min_length");
p_regexp = $("custom_field_regexp");
p_values = $("custom_field_possible_values");
p_searchable = $("custom_field_searchable");
switch (format.value) {
case "list":
Element.hide(p_length.parentNode);
Element.hide(p_regexp.parentNode);
Element.show(p_searchable.parentNode);
Element.show(p_values);
break;
case "date":
case "bool":
Element.hide(p_length.parentNode);
Element.hide(p_regexp.parentNode);
Element.hide(p_searchable.parentNode);
Element.hide(p_values);
break;
case "float":
case "int":
Element.show(p_length.parentNode);
Element.show(p_regexp.parentNode);
Element.hide(p_searchable.parentNode);
Element.hide(p_values);
break;
default:
Element.show(p_length.parentNode);
Element.show(p_regexp.parentNode);
Element.show(p_searchable.parentNode);
Element.hide(p_values);
break;
}
@@ -58,6 +47,7 @@ function deleteValueField(e) {
//]]>
</script>
<!--[form:custom_field]-->
<div class="box">
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
@@ -69,8 +59,11 @@ function deleteValueField(e) {
<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
<% end %>
</p>
</div>
<%= javascript_tag "toggle_custom_field_format();" %>
<!--[eoform:custom_field]-->
<div class="box">
<% case @custom_field.type.to_s
@@ -85,7 +78,6 @@ when "IssueCustomField" %>
<p><%= f.check_box :is_required %></p>
<p><%= f.check_box :is_for_all %></p>
<p><%= f.check_box :is_filter %></p>
<p><%= f.check_box :searchable %></p>
<% when "UserCustomField" %>
<p><%= f.check_box :is_required %></p>
@@ -95,4 +87,3 @@ when "IssueCustomField" %>
<% end %>
</div>
<%= javascript_tag "toggle_custom_field_format();" %>

View File

@@ -30,17 +30,16 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</div>
<%= textilizable(comment.comments) %>
<%= simple_format(auto_link(h(comment.comments)))%>
<% end if @news.comments_count > 0 %>
</div>
<% if authorize_for 'news', 'add_comment' %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
<% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %>
<%= text_area 'comment', 'comments', :cols => 60, :rows => 6 %>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
<% end %>
<% set_html_title(h(@news.title)) -%>
<% set_html_title h(@news.title) -%>

View File

@@ -17,7 +17,7 @@
</tr>
<% line_num += 1 %>
<% end %>
</tbody>
<tbody>
</table>
</div>

View File

@@ -11,7 +11,7 @@
</tr>
<% line_num += 1 %>
<% end %>
</tbody>
<tbody>
</table>
</div>

View File

@@ -1,9 +0,0 @@
class AddCustomFieldsSearchable < ActiveRecord::Migration
def self.up
add_column :custom_fields, :searchable, :boolean, :default => false
end
def self.down
remove_column :custom_fields, :searchable
end
end

View File

@@ -5,29 +5,6 @@ Copyright (C) 2006-2007 Jean-Philippe Lang
http://www.redmine.org/
== 2007-12-18 v0.6.3
* Fixed: upload doesn't work in 'Files' section
== 2007-12-16 v0.6.2
* Search engine: issue custom fields can now be searched
* News comments are now textilized
* Updated Japanese translation (Satoru Kurashiki)
* Updated Chinese translation (Shortie Lo)
* Fixed Rails 2.0 compatibility bugs:
* Unable to create a wiki
* Gantt and calendar error
* Trac importer error (readonly? is defined by ActiveRecord)
* Fixed: 'assigned to me' filter broken
* Fixed: crash when validation fails on issue edition with no custom fields
* Fixed: reposman "can't find group" error
* Fixed: 'LDAP account password is too long' error when leaving the field empty on creation
* Fixed: empty lines when displaying repository files with Windows style eol
* Fixed: missing body closing tag in repository annotate and entry views
== 2007-12-10 v0.6.1
* Rails 2.0 compatibility
@@ -49,7 +26,7 @@ http://www.redmine.org/
* Diff style (inline or side by side) automatically saved as a user preference
* Added issues status changes on the activity view (by Cyril Mougel)
* Added forums topics on the activity view (disabled by default)
* Added an option on 'My account' for users who don't want to be notified of changes that they make
* Added an option on 'My account' for users who dont want to be notified of changes that they make
* Trac importer now supports mysql and postgresql databases
* Trac importer improvements (by Mat Trudel)
* 'fixed version' field can now be displayed on the issue list
@@ -84,7 +61,7 @@ http://www.redmine.org/
* Fixed: admin should be able to move issues to any project
* Fixed: adding an attachment is not possible when changing the status of an issue
* Fixed: No mime-types in documents/files downloading
* Fixed: error when sorting the messages if there's only one board for the project
* Fixed: error when sorting the messages if theres only one board for the project
* Fixed: 'me' doesn't appear in the drop down filters on a project issue list.
== 2007-11-04 v0.6.0

View File

@@ -8,14 +8,6 @@ Subversion
svnadmin create tmp/test/subversion_repository
gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load tmp/test/subversion_repository
CVS
---
gunzip < test/fixtures/repositories/cvs_repository.tar.gz | tar -xv -C tmp/test
Bazaar
------
gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test
Mercurial
---------
gunzip < test/fixtures/repositories/mercurial_repository.tar.gz | tar -xv -C tmp/test
gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test

View File

@@ -78,7 +78,6 @@ $quiet = false
$redmine_host = ''
$repos_base = ''
$svn_owner = 'root'
$use_groupid = true
$svn_url = false
$test = false
@@ -93,7 +92,7 @@ begin
case opt
when '--svn-dir'; $repos_base = arg.dup
when '--redmine-host'; $redmine_host = arg.dup
when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
when '--owner'; $svn_owner = arg.dup
when '--url'; $svn_url = arg.dup
when '--verbose'; $verbose += 1
when '--test'; $test = true
@@ -145,7 +144,7 @@ def set_owner_and_rights(project, repos_path, &block)
if RUBY_PLATFORM =~ /mswin/
yield if block_given?
else
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : 0)
uid, gid = Etc.getpwnam($svn_owner).uid, Etc.getgrnam(project.identifier).gid
right = project.is_public ? 0775 : 0770
yield if block_given?
Find.find(repos_path) do |f|

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Muss mindestens %d Zeichen lang sein.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -170,7 +170,6 @@ field_redirect_existing_links: Redirect existing links
field_estimated_hours: Estimated time
field_column_names: Columns
field_time_zone: Time zone
field_searchable: Searchable
setting_app_title: Application title
setting_app_subtitle: Application subtitle

View File

@@ -552,4 +552,3 @@ setting_time_format: Formato de hora
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -170,7 +170,6 @@ field_redirect_existing_links: Rediriger les liens existants
field_estimated_hours: Temps estimé
field_column_names: Colonnes
field_time_zone: Fuseau horaire
field_searchable: Utilisé pour les recherches
setting_app_title: Titre de l'application
setting_app_subtitle: Sous-titre de l'application

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -72,13 +72,13 @@ notice_locking_conflict: 別のユーザがデータを更新しています。
notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。
notice_not_authorized: このページにアクセスするには認証が必要です。
notice_email_sent: %s宛にメールを送信しました。
notice_email_error: メール送信中にエラーが発生しました(%s)
notice_email_error: メール送信中にエラーが発生しました (%s)
notice_feeds_access_key_reseted: RSSアクセスキーを初期化しました。
mail_subject_lost_password: Redmineパスワード
mail_subject_lost_password: redMineパスワード
mail_body_lost_password: 'パスワードを変更するには、以下のリンクをたどってください:'
mail_subject_register: Redmineアカウントが有効になりました
mail_body_register: 'Redmineアカウントをアクティブにするには、以下のリンクをたどってください:'
mail_subject_register: redMineアカウントが有効になりました
mail_body_register: 'Redmine アカウントをアクティブにするには、以下のリンクをたどってください:'
gui_validation_error: 1件のエラー
gui_validation_error_plural: %d件のエラー
@@ -159,8 +159,8 @@ field_identifier: 識別子
field_is_filter: フィルタとして使う
field_issue_to_id: 関連する問題
field_delay: 遅延
field_assignable: 問題はこのロールに割り当てることができます
field_redirect_existing_links: 既存のリンクをリダイレクトする
field_assignable: Issues can be assigned to this role
field_redirect_existing_links: Redirect existing links
field_estimated_hours: 予定工数
setting_app_title: アプリケーションのタイトル
@@ -410,18 +410,18 @@ label_message_last: 最新のメッセージ
label_message_new: 新しいメッセージ
label_reply_plural: 返答
label_send_information: アカウント情報をユーザに送信
label_year:
label_month:
label_week:
label_date_from: から
label_date_to: まで
label_year: Year
label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: 既定の言語の設定に従う
label_sort_by: %sで並び替え
label_sort_by: Sort by %s
label_send_test_email: テストメールを送信
label_feeds_access_key_created_on: RSSアクセスキーは%s前に作成されました
label_module_plural: モジュール
label_added_time_by: %s%s前に追加しました
label_updated_time: %s前に更新されました
label_feeds_access_key_created_on: RSS access key created %s ago
label_module_plural: Modules
label_added_time_by: Added by %s %s ago
label_updated_time: Updated %s ago
label_jump_to_a_project: プロジェクトへ移動...
button_login: ログイン
@@ -454,8 +454,8 @@ button_unwatch: ウォッチをやめる
button_reply: 返答
button_archive: 書庫に保存
button_unarchive: 書庫から戻す
button_reset: リセット
button_rename: 名前変更
button_reset: Reset
button_rename: Rename
status_active: 有効
status_registered: 登録
@@ -482,10 +482,10 @@ text_comma_separated: (カンマで区切った)複数の値が使えます
text_issues_ref_in_commit_messages: コミットメッセージ内で問題の参照/修正
text_issue_added: 問題 %s が報告されました。
text_issue_updated: 問題 %s が更新されました。
text_wiki_destroy_confirmation: 本当にこのwikiとその内容の全てを削除しますか
text_issue_category_destroy_question: このカテゴリに割り当て済みの問題(%d)があります。何をしようとしていますか?
text_issue_category_destroy_assignments: カテゴリの割り当てを削除する
text_issue_category_reassign_to: 問題をこのカテゴリに再割り当てする
text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content ?
text_issue_category_destroy_question: Some issues (%d) are assigned to this category. What do you want to do ?
text_issue_category_destroy_assignments: Remove category assignments
text_issue_category_reassign_to: Reassing issues to this category
default_role_manager: 管理者
default_role_developper: 開発者
@@ -512,8 +512,8 @@ default_activity_development: 開発作業
enumeration_issue_priorities: 問題の優先度
enumeration_doc_categories: 文書カテゴリ
enumeration_activities: 作業分類 (時間トラッキング)
label_file_plural: ファイル
label_changeset_plural: チェンジセット
label_file_plural: Files
label_changeset_plural: Changesets
field_column_names: 項目
label_default_columns: 既定の項目
setting_issue_list_default_columns: 問題の一覧で表示する項目
@@ -534,20 +534,19 @@ label_user_mail_option_none: "ウォッチまたは関係している問題の
setting_emails_footer: メールのフッタ
label_float: 小数
button_copy: コピー
mail_body_account_information_external: 「%s」アカウントを使ってRedmineにログインできます。
mail_body_account_information: Redmineアカウント情報
setting_protocol: プロトコル
label_user_mail_no_self_notified: 自分自身による変更の通知は不要です
setting_time_format: 時刻の形式
label_registration_activation_by_email: メールでアカウントを有効化
mail_subject_account_activation_request: Redminアカウントの有効化要求
mail_body_account_activation_request: 新しいユーザ(%s)が登録しています。このアカウントはあなたの承認待ちです:
label_registration_automatic_activation: 自動でアカウントを有効化
label_registration_manual_activation: 手動でアカウントを有効化
notice_account_pending: アカウントは作成済みで、管理者の承認待ちです。
field_time_zone: タイムゾーン
text_caracters_minimum: 最低%d文字の長さが必要です
setting_bcc_recipients: ブラインドカーボンコピーで受信(bcc)
button_annotate: 注釈
label_issues_by: %s別の問題
field_searchable: Searchable
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
mail_body_account_information: Your Redmine account information
setting_protocol: Protocol
label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
setting_time_format: Time format
label_registration_activation_by_email: account activation by email
mail_subject_account_activation_request: Redmine account activation request
mail_body_account_activation_request: 'A new user (%s) has registered. His account his pending your approval:'
label_registration_automatic_activation: automatic account activation
label_registration_manual_activation: manual account activation
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -550,4 +550,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Musi być nie krótsze niż %d znaków.
setting_bcc_recipients: Odbiorcy kopii tajnej (kt/bcc)
button_annotate: Adnotuj
label_issues_by: Zagadnienia wprowadzone przez %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -549,4 +549,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -550,4 +550,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -550,4 +550,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -5,8 +5,8 @@ actionview_datehelper_select_month_names: 一月,二月,三月,四月,五月,六
actionview_datehelper_select_month_names_abbr: 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月
actionview_datehelper_select_month_prefix:
actionview_datehelper_select_year_prefix:
actionview_datehelper_time_in_words_day: 1
actionview_datehelper_time_in_words_day_plural: %d
actionview_datehelper_time_in_words_day: 1
actionview_datehelper_time_in_words_day_plural: %d
actionview_datehelper_time_in_words_hour_about: 約 1 小時
actionview_datehelper_time_in_words_hour_about_plural: 約 %d 小時
actionview_datehelper_time_in_words_hour_about_single: 約 1 小時
@@ -46,10 +46,10 @@ general_text_No: 'No'
general_text_Yes: 'Yes'
general_text_no: 'no'
general_text_yes: 'yes'
general_lang_name: 'Chinese (繁體中文)'
general_lang_name: 'Traditional Chinese (繁體中文)'
general_csv_separator: ','
general_csv_encoding: Big5
general_pdf_encoding: Big5
general_csv_encoding: ISO-8859-1
general_pdf_encoding: big5
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日
general_first_day_of_week: '7'
@@ -62,9 +62,9 @@ notice_account_unknown_email: Unknown user.
notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
notice_account_activated: Your account has been activated. You can now log in.
notice_successful_create: 建立成功
notice_successful_update: 更新成功
notice_successful_delete: 刪除成功
notice_successful_create: Successful creation.
notice_successful_update: Successful update.
notice_successful_delete: Successful deletion.
notice_successful_connection: Successful connection.
notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
notice_locking_conflict: Data have been updated by another user.
@@ -122,7 +122,7 @@ field_subject: 主旨
field_due_date: 完成日期
field_assigned_to: 分派給
field_priority: 重要性
field_fixed_version: 版本
field_fixed_version: Fixed version
field_user: 用戶
field_role: 角色
field_homepage: 網站首頁
@@ -151,21 +151,21 @@ field_attr_lastname: Lastname attribute
field_attr_mail: Email attribute
field_onthefly: On-the-fly user creation
field_start_date: 開始日期
field_done_ratio: 完成百分比
field_done_ratio: %% 已完成
field_auth_source: 認證模式
field_hide_mail: 隱藏我的電子郵件
field_comments: 註解
field_url: URL
field_start_page: 首頁
field_start_page: Start page
field_subproject: 子專案
field_hours: 小時
field_activity: 活動
field_activity: Activity
field_spent_on: 日期
field_identifier: 代碼
field_is_filter: Used as a filter
field_issue_to_id: Related issue
field_delay: 逾期
field_assignable: 項目可被分派至此角色
field_assignable: Issues can be assigned to this role
field_redirect_existing_links: Redirect existing links
field_estimated_hours: 預估工時
field_column_names: Columns
@@ -304,9 +304,9 @@ label_open_issues: 進行中
label_open_issues_plural: 進行中
label_closed_issues: 已結束
label_closed_issues_plural: 已結束
label_total: 總計
label_total: Total
label_permissions: 權限
label_current_status: 目前狀態
label_current_status: Current status
label_new_statuses_allowed: New statuses allowed
label_all: 全部
label_none: 空值
@@ -314,11 +314,11 @@ label_nobody: nobody
label_next: Next
label_previous: Previous
label_used_by: Used by
label_details: 明細
label_details: Details
label_add_note: 加入一個新筆記
label_per_page: 每頁
label_calendar: 日曆
label_months_from: 個月, 開始月份
label_months_from: months from
label_gantt: 甘特圖
label_internal: Internal
label_last_changes: 最近 %d 個變更
@@ -360,7 +360,7 @@ label_latest_revision: 最新版次
label_latest_revision_plural: 最近版次清單
label_view_revisions: 檢視版次清單
label_max_size: 最大長度
label_on: 總共
label_on: 'on'
label_sort_highest: 移動至開頭
label_sort_higher: 往上移動
label_sort_lower: 往下移動
@@ -368,7 +368,7 @@ label_sort_lowest: 移動至結尾
label_roadmap: 版本藍圖
label_roadmap_due_in: 倒數天數:
label_roadmap_overdue: %s 逾期
label_roadmap_no_issues: 此版本尚未包含任何項目
label_roadmap_no_issues: No issues for this version
label_search: 搜尋
label_result_plural: 結果
label_all_words: All words
@@ -382,13 +382,13 @@ label_index_by_date: 依日期索引
label_current_version: 現行版本
label_preview: 預覽
label_feed_plural: Feeds
label_changes_details: 所有變更的明細
label_changes_details: Details of all changes
label_issue_tracking: 項目追蹤
label_spent_time: 耗用時間
label_f_hour: %.2f 小時
label_f_hour_plural: %.2f 小時
label_f_hour: %.2f hour
label_f_hour_plural: %.2f hours
label_time_tracking: Time tracking
label_change_plural: 變更
label_change_plural: Changes
label_statistics: Statistics
label_commits_per_month: Commits per month
label_commits_per_author: Commits per author
@@ -405,11 +405,11 @@ label_loading: 載入中...
label_relation_new: 建立新關聯
label_relation_delete: 刪除關聯
label_relates_to: 關聯至
label_duplicates: 已重複
label_blocks: 阻擋
label_blocked_by: 被阻擋
label_precedes: 優先於
label_follows: 跟隨於
label_duplicates: duplicates
label_blocks: blocks
label_blocked_by: blocked by
label_precedes: precedes
label_follows: follows
label_end_to_start: end to start
label_end_to_end: end to end
label_start_to_start: start to start
@@ -501,9 +501,9 @@ text_regexp_info: eg. ^[A-Z0-9]+$
text_min_max_length_info: 0 means no restriction
text_project_destroy_confirmation: Are you sure you want to delete this project and all related data ?
text_workflow_edit: Select a role and a tracker to edit the workflow
text_are_you_sure: 確定執行?
text_journal_changed: %s 變更為 %s
text_journal_set_to: 設定為 %s
text_are_you_sure: Are you sure ?
text_journal_changed: changed from %s to %s
text_journal_set_to: set to %s
text_journal_deleted: deleted
text_tip_task_begin_day: task beginning this day
text_tip_task_end_day: task ending this day
@@ -541,12 +541,11 @@ default_doc_category_tech: 技術文件
default_priority_low:
default_priority_normal: 正常
default_priority_high:
default_priority_urgent:
default_priority_immediate:
default_priority_urgent:
default_priority_immediate:
default_activity_design: 設計
default_activity_development: 開發
enumeration_issue_priorities: 項目重要性
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (time tracking)
field_searchable: Searchable

View File

@@ -552,4 +552,3 @@ text_caracters_minimum: Must be at least %d characters long.
setting_bcc_recipients: Blind carbon copy recipients (bcc)
button_annotate: Annotate
label_issues_by: Issues by %s
field_searchable: Searchable

View File

@@ -112,15 +112,9 @@ module Redmine
def shellout(cmd, &block)
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
begin
IO.popen(cmd, "r+") do |io|
io.close_write
block.call(io) if block_given?
end
rescue Errno::ENOENT => e
# The command failed, log it and re-raise
log.error("SCM command failed: #{cmd}\n with: #{e.message}")
raise CommandFailed
IO.popen(cmd, "r+") do |io|
io.close_write
block.call(io) if block_given?
end
end
end

View File

@@ -40,7 +40,7 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
info
rescue CommandFailed
rescue Errno::ENOENT => e
return nil
end
@@ -81,6 +81,8 @@ module Redmine
return nil if $? && $?.exitstatus != 0
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
entries.sort_by_name
rescue Errno::ENOENT => e
raise CommandFailed
end
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
@@ -142,6 +144,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
revisions
rescue Errno::ENOENT => e
raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
@@ -159,7 +163,9 @@ module Redmine
end
end
#return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
DiffTableList.new diff, type
rescue Errno::ENOENT => e
raise CommandFailed
end
def cat(path, identifier=nil)
@@ -173,6 +179,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
cat
rescue Errno::ENOENT => e
raise CommandFailed
end
def annotate(path, identifier=nil)
@@ -190,6 +198,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
blame
rescue Errno::ENOENT => e
raise CommandFailed
end
end
end

View File

@@ -103,6 +103,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
rescue Errno::ENOENT => e
raise CommandFailed
end
STARTLOG="----------------------------"
@@ -232,6 +234,8 @@ module Redmine
end
end
end
rescue Errno::ENOENT => e
raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
@@ -246,6 +250,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
rescue Errno::ENOENT => e
raise CommandFailed
end
def cat(path, identifier=nil)
@@ -259,6 +265,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
cat
rescue Errno::ENOENT => e
raise CommandFailed
end
def annotate(path, identifier=nil)
@@ -275,6 +283,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
blame
rescue Errno::ENOENT => e
raise CommandFailed
end
private

View File

@@ -70,6 +70,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
rescue Errno::ENOENT => e
raise CommandFailed
end
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
@@ -97,6 +99,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
revisions
rescue Errno::ENOENT => e
raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
@@ -113,6 +117,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
rescue Errno::ENOENT => e
raise CommandFailed
end
private
@@ -148,7 +154,7 @@ module Redmine
end
end
paths
rescue CommandFailed
rescue Errno::ENOENT => e
paths
end
end

View File

@@ -36,7 +36,7 @@ module Redmine
:lastrev => revisions(nil,nil,nil,{:limit => 1}).last
})
info
rescue CommandFailed
rescue Errno::ENOENT => e
return nil
end
@@ -58,6 +58,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
entries.sort_by_name
rescue Errno::ENOENT => e
raise CommandFailed
end
def entry(path=nil, identifier=nil)
@@ -117,6 +119,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
revisions
rescue Errno::ENOENT => e
raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
@@ -136,6 +140,9 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
rescue Errno::ENOENT => e
raise CommandFailed
end
def cat(path, identifier=nil)
@@ -147,6 +154,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
cat
rescue Errno::ENOENT => e
raise CommandFailed
end
def annotate(path, identifier=nil)
@@ -164,6 +173,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
blame
rescue Errno::ENOENT => e
raise CommandFailed
end
end
end

View File

@@ -47,7 +47,7 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
info
rescue CommandFailed
rescue Errno::ENOENT => e
return nil
end
@@ -91,6 +91,8 @@ module Redmine
return nil if $? && $?.exitstatus != 0
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
entries.sort_by_name
rescue Errno::ENOENT => e
raise CommandFailed
end
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
@@ -128,6 +130,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
revisions
rescue Errno::ENOENT => e
raise CommandFailed
end
def diff(path, identifier_from, identifier_to=nil, type="inline")
@@ -150,6 +154,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
DiffTableList.new diff, type
rescue Errno::ENOENT => e
raise CommandFailed
end
def cat(path, identifier=nil)
@@ -163,6 +169,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
cat
rescue Errno::ENOENT => e
raise CommandFailed
end
def annotate(path, identifier=nil)
@@ -178,6 +186,8 @@ module Redmine
end
return nil if $? && $?.exitstatus != 0
blame
rescue Errno::ENOENT => e
raise CommandFailed
end
private

View File

@@ -4,7 +4,7 @@ module Redmine
module VERSION #:nodoc:
MAJOR = 0
MINOR = 6
TINY = 3
TINY = 1
def self.revision
revision = nil

View File

@@ -145,11 +145,6 @@ namespace :redmine do
class TracWikiPage < ActiveRecord::Base
set_table_name :wiki
def self.columns
# Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
super.select {|column| column.name.to_s != 'readonly'}
end
end
class TracPermission < ActiveRecord::Base

View File

@@ -11,17 +11,16 @@ custom_fields_001:
is_required: false
field_format: list
custom_fields_002:
name: Searchable field
name: Build
min_length: 1
regexp: ""
is_for_all: true
type: IssueCustomField
max_length: 100
max_length: 10
possible_values: ""
id: 2
is_required: false
field_format: string
searchable: true
custom_fields_003:
name: Development status
min_length: 0

View File

@@ -46,11 +46,4 @@ custom_values_008:
custom_field_id: 1
customized_id: 3
id: 11
value: "MySQL"
custom_values_009:
customized_type: Issue
custom_field_id: 2
customized_id: 3
id: 12
value: "this is a stringforcustomfield search"
value: "MySQL"

View File

@@ -31,12 +31,3 @@ enabled_modules_008:
name: boards
project_id: 1
id: 8
enabled_modules_009:
name: repository
project_id: 3
id: 9
enabled_modules_010:
name: wiki
project_id: 3
id: 10

View File

@@ -41,8 +41,6 @@ issues_003:
assigned_to_id:
author_id: 2
status_id: 1
start_date: <%= 1.day.from_now.to_date.to_s(:db) %>
due_date: <%= 40.day.ago.to_date.to_s(:db) %>
issues_004:
created_on: 2006-07-19 21:07:27 +02:00
project_id: 2

View File

@@ -1,12 +1,11 @@
---
repositories_001:
project_id: 1
url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
url: svn://localhost/test
id: 10
root_url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
root_url: svn://localhost
password: ""
login: ""
type: Subversion
repositories_002:
project_id: 2
url: svn://localhost/test
@@ -14,4 +13,3 @@ repositories_002:
root_url: svn://localhost
password: ""
login: ""
type: Subversion

Binary file not shown.

View File

@@ -39,6 +39,7 @@ roles_005:
- :view_time_entries
- :view_documents
- :view_wiki_pages
- :edit_wiki_pages
- :view_files
- :browse_repository
- :view_changesets
@@ -74,10 +75,7 @@ roles_001:
- :view_wiki_pages
- :edit_wiki_pages
- :delete_wiki_pages
- :rename_wiki_pages
- :add_messages
- :edit_messages
- :delete_messages
- :manage_boards
- :view_files
- :manage_files

View File

@@ -37,16 +37,4 @@ wiki_content_versions_003:
author_id: 1
comments: ""
wiki_content_id: 1
compression: ""
data: |-
h1. CookBook documentation
Some updated [[documentation]] here...
wiki_content_versions_004:
data: |-
h1. Another page
This is a link to a ticket: #2
updated_on: 2007-03-08 00:18:07 +01:00
page_id: 2
wiki_content_id: 2
id: 4
compression: ""

View File

@@ -10,15 +10,3 @@ wiki_contents_001:
page_id: 1
id: 1
version: 3
author_id: 1
comments: Gzip compression activated
wiki_contents_002:
text: |-
h1. Another page
This is a link to a ticket: #2
updated_on: 2007-03-08 00:18:07 +01:00
page_id: 2
id: 2
version: 1
author_id: 1

View File

@@ -4,9 +4,3 @@ wiki_pages_001:
title: CookBook_documentation
id: 1
wiki_id: 1
wiki_pages_002:
created_on: 2007-03-08 00:18:07 +01:00
title: Another_page
id: 2
wiki_id: 1

View File

@@ -1,73 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'account_controller'
# Re-raise errors caught by the controller.
class AccountController; def rescue_action(e) raise e end; end
class AccountControllerTest < Test::Unit::TestCase
fixtures :users
def setup
@controller = AccountController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
end
def test_show
get :show, :id => 2
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
end
def test_show_inactive
get :show, :id => 5
assert_response 404
assert_nil assigns(:user)
end
def test_login_with_wrong_password
post :login, :login => 'admin', :password => 'bad'
assert_response :success
assert_template 'login'
assert_tag 'div',
:attributes => { :class => "flash error" },
:content => /Invalid user or password/
end
def test_autologin
Setting.autologin = "7"
Token.delete_all
post :login, :login => 'admin', :password => 'admin', :autologin => 1
assert_redirected_to 'my/page'
token = Token.find :first
assert_not_nil token
assert_equal User.find_by_login('admin'), token.user
assert_equal 'autologin', token.action
end
def test_logout
@request.session[:user_id] = 2
get :logout
assert_redirected_to ''
assert_nil @request.session[:user_id]
end
end

View File

@@ -1,61 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'admin_controller'
# Re-raise errors caught by the controller.
class AdminController; def rescue_action(e) raise e end; end
class AdminControllerTest < Test::Unit::TestCase
fixtures :projects, :users
def setup
@controller = AdminController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
def test_get_mail_options
get :mail_options
assert_response :success
assert_template 'mail_options'
end
def test_post_mail_options
post :mail_options, :settings => {'mail_from' => 'functional@test.foo'}
assert_redirected_to 'admin/mail_options'
assert_equal 'functional@test.foo', Setting.mail_from
end
def test_test_email
get :test_email
assert_redirected_to 'admin/mail_options'
mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail
user = User.find(1)
assert_equal [user.mail], mail.bcc
end
def test_info
get :info
assert_response :success
assert_template 'info'
end
end

View File

@@ -22,17 +22,7 @@ require 'issues_controller'
class IssuesController; def rescue_action(e) raise e end; end
class IssuesControllerTest < Test::Unit::TestCase
fixtures :projects,
:users,
:roles,
:members,
:issues,
:issue_statuses,
:trackers,
:issue_categories,
:enabled_modules,
:enumerations,
:attachments
fixtures :projects, :users, :roles, :members, :issues, :enabled_modules, :enumerations
def setup
@controller = IssuesController.new
@@ -93,71 +83,4 @@ class IssuesControllerTest < Test::Unit::TestCase
assert_not_nil assigns(:changes)
assert_equal 'application/atom+xml', @response.content_type
end
def test_show
get :show, :id => 1
assert_response :success
assert_template 'show.rhtml'
assert_not_nil assigns(:issue)
end
def test_get_edit
@request.session[:user_id] = 2
get :edit, :id => 1
assert_response :success
assert_template 'edit'
assert_not_nil assigns(:issue)
assert_equal Issue.find(1), assigns(:issue)
end
def test_post_edit
@request.session[:user_id] = 2
post :edit, :id => 1, :issue => {:subject => 'Modified subject'}
assert_redirected_to 'issues/show/1'
assert_equal 'Modified subject', Issue.find(1).subject
end
def test_post_change_status
issue = Issue.find(1)
assert_equal 1, issue.status_id
@request.session[:user_id] = 2
post :change_status, :id => 1,
:new_status_id => 2,
:issue => { :assigned_to_id => 3 },
:notes => 'Assigned to dlopper',
:confirm => 1
assert_redirected_to 'issues/show/1'
issue.reload
assert_equal 2, issue.status_id
j = issue.journals.find(:first, :order => 'created_on DESC')
assert_equal 'Assigned to dlopper', j.notes
assert_equal 2, j.details.size
end
def test_context_menu
@request.session[:user_id] = 2
get :context_menu, :id => 1
assert_response :success
assert_template 'context_menu'
end
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1
assert_redirected_to 'projects/1/issues'
assert_nil Issue.find_by_id(1)
end
def test_destroy_attachment
issue = Issue.find(3)
a = issue.attachments.size
@request.session[:user_id] = 2
post :destroy_attachment, :id => 3, :attachment_id => 1
assert_redirected_to 'issues/show/3'
assert_nil Attachment.find_by_id(1)
issue.reload
assert_equal((a-1), issue.attachments.size)
j = issue.journals.find(:first, :order => 'created_on DESC')
assert_equal 'attachment', j.details.first.property
end
end

View File

@@ -40,60 +40,10 @@ class MessagesControllerTest < Test::Unit::TestCase
assert_not_nil assigns(:topic)
end
def test_show_message_not_found
get :show, :board_id => 1, :id => 99999
assert_response 404
end
def test_get_new
@request.session[:user_id] = 2
get :new, :board_id => 1
assert_response :success
assert_template 'new'
end
def test_post_new
@request.session[:user_id] = 2
post :new, :board_id => 1,
:message => { :subject => 'Test created message',
:content => 'Message body'}
assert_redirected_to 'messages/show'
message = Message.find_by_subject('Test created message')
assert_not_nil message
assert_equal 'Message body', message.content
assert_equal 2, message.author_id
assert_equal 1, message.board_id
end
def test_get_edit
@request.session[:user_id] = 2
get :edit, :board_id => 1, :id => 1
assert_response :success
assert_template 'edit'
end
def test_post_edit
@request.session[:user_id] = 2
post :edit, :board_id => 1, :id => 1,
:message => { :subject => 'New subject',
:content => 'New body'}
assert_redirected_to 'messages/show'
message = Message.find(1)
assert_equal 'New subject', message.subject
assert_equal 'New body', message.content
end
def test_reply
@request.session[:user_id] = 2
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
assert_redirected_to 'messages/show'
assert Message.find_by_subject('Test reply')
end
def test_destroy_topic
@request.session[:user_id] = 2
post :destroy, :board_id => 1, :id => 1
assert_redirected_to 'boards/show'
assert_nil Message.find_by_id(1)
end
end

View File

@@ -22,7 +22,7 @@ require 'my_controller'
class MyController; def rescue_action(e) raise e end; end
class MyControllerTest < Test::Unit::TestCase
fixtures :users, :issues, :issue_statuses, :trackers, :enumerations
fixtures :users
def setup
@controller = MyController.new

View File

@@ -22,7 +22,7 @@ require 'projects_controller'
class ProjectsController; def rescue_action(e) raise e end; end
class ProjectsControllerTest < Test::Unit::TestCase
fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
fixtures :projects, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
def setup
@controller = ProjectsController.new
@@ -41,10 +41,6 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'list'
assert_not_nil assigns(:project_tree)
# Root project as hash key
assert assigns(:project_tree).has_key?(Project.find(1))
# Subproject in corresponding value
assert assigns(:project_tree)[Project.find(1)].include?(Project.find(3))
end
def test_show
@@ -52,37 +48,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'show'
assert_not_nil assigns(:project)
end
def test_settings
@request.session[:user_id] = 2 # manager
get :settings, :id => 1
assert_response :success
assert_template 'settings'
end
def test_edit
@request.session[:user_id] = 2 # manager
post :edit, :id => 1, :project => {:name => 'Test changed name'}
assert_redirected_to 'projects/settings/1'
project = Project.find(1)
assert_equal 'Test changed name', project.name
end
def test_get_destroy
@request.session[:user_id] = 1 # admin
get :destroy, :id => 1
assert_response :success
assert_template 'destroy'
assert_not_nil Project.find_by_id(1)
end
def test_post_destroy
@request.session[:user_id] = 1 # admin
post :destroy, :id => 1, :confirm => 1
assert_redirected_to 'admin/projects'
assert_nil Project.find_by_id(1)
end
def test_list_documents
get :list_documents, :id => 1
@@ -100,23 +66,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_equal [7, 7], Issue.find_all_by_id([1, 2]).collect {|i| i.priority.id}
assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes
end
def test_move_issues_to_another_project
@request.session[:user_id] = 1
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_project_id => 2
assert_redirected_to 'projects/1/issues'
assert_equal 2, Issue.find(1).project_id
assert_equal 2, Issue.find(2).project_id
end
def test_move_issues_to_another_tracker
@request.session[:user_id] = 1
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_tracker_id => 3
assert_redirected_to 'projects/1/issues'
assert_equal 3, Issue.find(1).tracker_id
assert_equal 3, Issue.find(2).tracker_id
end
def test_list_files
get :list_files, :id => 1
assert_response :success
@@ -136,21 +86,6 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'roadmap'
assert_not_nil assigns(:versions)
# Version with no date set appears
assert assigns(:versions).include?(Version.find(3))
# Completed version doesn't appear
assert !assigns(:versions).include?(Version.find(1))
end
def test_roadmap_with_completed_versions
get :roadmap, :id => 1, :completed => 1
assert_response :success
assert_template 'roadmap'
assert_not_nil assigns(:versions)
# Version with no date set appears
assert assigns(:versions).include?(Version.find(3))
# Completed version appears
assert assigns(:versions).include?(Version.find(1))
end
def test_activity
@@ -185,42 +120,6 @@ class ProjectsControllerTest < Test::Unit::TestCase
}
end
def test_calendar
get :calendar, :id => 1
assert_response :success
assert_template 'calendar'
assert_not_nil assigns(:calendar)
end
def test_calendar_with_subprojects
get :calendar, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
assert_response :success
assert_template 'calendar'
assert_not_nil assigns(:calendar)
end
def test_gantt
get :gantt, :id => 1
assert_response :success
assert_template 'gantt.rhtml'
assert_not_nil assigns(:events)
end
def test_gantt_with_subprojects
get :gantt, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
assert_response :success
assert_template 'gantt.rhtml'
assert_not_nil assigns(:events)
end
def test_gantt_export_to_pdf
get :gantt, :id => 1, :format => 'pdf'
assert_response :success
assert_template 'gantt.rfpdf'
assert_equal 'application/pdf', @response.content_type
assert_not_nil assigns(:events)
end
def test_archive
@request.session[:user_id] = 1 # admin
post :archive, :id => 1

View File

@@ -31,13 +31,6 @@ class RepositoriesControllerTest < Test::Unit::TestCase
User.current = nil
end
def test_revisions
get :revisions, :id => 1
assert_response :success
assert_template 'revisions'
assert_not_nil assigns(:changesets)
end
def test_revision_with_before_nil_and_afer_normal
get :revision, {:id => 1, :rev => 1}
assert_response :success
@@ -50,15 +43,4 @@ class RepositoriesControllerTest < Test::Unit::TestCase
}
end
def test_graph_commits_per_month
get :graph, :id => 1, :graph => 'commits_per_month'
assert_response :success
assert_equal 'image/svg+xml', @response.content_type
end
def test_graph_commits_per_author
get :graph, :id => 1, :graph => 'commits_per_author'
assert_response :success
assert_equal 'image/svg+xml', @response.content_type
end
end

View File

@@ -1,117 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'repositories_controller'
# Re-raise errors caught by the controller.
class RepositoriesController; def rescue_action(e) raise e end; end
class RepositoriesMercurialControllerTest < Test::Unit::TestCase
fixtures :projects, :users, :roles, :members, :repositories, :enabled_modules
# No '..' in the repository path
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/mercurial_repository'
def setup
@controller = RepositoriesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
end
def test_show
get :show, :id => 3
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:changesets)
end
def test_browse_root
get :browse, :id => 3
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
assert_equal 3, assigns(:entries).size
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
end
def test_browse_directory
get :browse, :id => 3, :path => ['images']
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
assert_equal 2, assigns(:entries).size
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
assert_not_nil entry
assert_equal 'file', entry.kind
assert_equal 'images/edit.png', entry.path
end
def test_changes
get :changes, :id => 3, :path => ['images', 'edit.png']
assert_response :success
assert_template 'changes'
assert_tag :tag => 'h2', :content => 'edit.png'
end
def test_entry_show
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
assert_response :success
assert_template 'entry'
# Line 19
assert_tag :tag => 'th',
:content => /10/,
:attributes => { :class => /line-num/ },
:sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
end
def test_entry_download
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
assert_response :success
# File content
assert @response.body.include?('WITHOUT ANY WARRANTY')
end
def test_diff
# Full diff of changeset 4
get :diff, :id => 3, :rev => 4
assert_response :success
assert_template 'diff'
# Line 22 removed
assert_tag :tag => 'th',
:content => /22/,
:sibling => { :tag => 'td',
:attributes => { :class => /diff_out/ },
:content => /def remove/ }
end
def test_annotate
get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
assert_response :success
assert_template 'annotate'
# Line 23, revision 4
assert_tag :tag => 'th', :content => /23/,
:sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
:sibling => { :tag => 'td', :content => /jsmith/ },
:sibling => { :tag => 'td', :content => /watcher =/ }
end
end

View File

@@ -1,91 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'repositories_controller'
# Re-raise errors caught by the controller.
class RepositoriesController; def rescue_action(e) raise e end; end
class RepositoriesSubversionControllerTest < Test::Unit::TestCase
fixtures :projects, :users, :roles, :members, :repositories, :issues, :issue_statuses, :changesets, :changes, :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
# No '..' in the repository path for svn
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/subversion_repository'
def setup
@controller = RepositoriesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
end
if File.directory?(REPOSITORY_PATH)
def test_show
get :show, :id => 1
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:changesets)
end
def test_browse_root
get :browse, :id => 1
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
entry = assigns(:entries).detect {|e| e.name == 'subversion_test'}
assert_equal 'dir', entry.kind
end
def test_browse_directory
get :browse, :id => 1, :path => ['subversion_test']
assert_response :success
assert_template 'browse'
assert_not_nil assigns(:entries)
entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'}
assert_equal 'file', entry.kind
assert_equal 'subversion_test/helloworld.c', entry.path
end
def test_entry
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c']
assert_response :success
assert_template 'entry'
end
def test_entry_download
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'
assert_response :success
end
def test_diff
get :diff, :id => 1, :rev => 3
assert_response :success
assert_template 'diff'
end
def test_annotate
get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c']
assert_response :success
assert_template 'annotate'
end
else
puts "Subversion test repository NOT FOUND. Skipping functional tests !!!"
def test_fake; assert true end
end
end

View File

@@ -5,7 +5,7 @@ require 'search_controller'
class SearchController; def rescue_action(e) raise e end; end
class SearchControllerTest < Test::Unit::TestCase
fixtures :projects, :issues, :custom_fields, :custom_values
fixtures :projects, :issues
def setup
@controller = SearchController.new
@@ -25,9 +25,7 @@ class SearchControllerTest < Test::Unit::TestCase
assert assigns(:results).include?(Project.find(1))
end
def test_search_without_searchable_custom_fields
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"
def test_search_in_project
get :index, :id => 1
assert_response :success
assert_template 'index'
@@ -38,15 +36,6 @@ class SearchControllerTest < Test::Unit::TestCase
assert_template 'index'
end
def test_search_with_searchable_custom_fields
get :index, :id => 1, :q => "stringforcustomfield"
assert_response :success
results = assigns(:results)
assert_not_nil results
assert_equal 1, results.size
assert results.include?(Issue.find(3))
end
def test_quick_jump_to_issue
# issue of a public project
get :index, :q => "3"

View File

@@ -1,62 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'users_controller'
# Re-raise errors caught by the controller.
class UsersController; def rescue_action(e) raise e end; end
class UsersControllerTest < Test::Unit::TestCase
fixtures :users, :projects, :members
def setup
@controller = UsersController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
def test_index
get :index
assert_response :success
assert_template 'list'
end
def test_list
get :list
assert_response :success
assert_template 'list'
assert_not_nil assigns(:users)
# active users only
assert_nil assigns(:users).detect {|u| !u.active?}
end
def test_edit_membership
post :edit_membership, :id => 2, :membership_id => 1,
:membership => { :role_id => 2}
assert_redirected_to 'users/edit/2'
assert_equal 2, Member.find(1).role_id
end
def test_destroy_membership
post :destroy_membership, :id => 2, :membership_id => 1
assert_redirected_to 'users/edit/2'
assert_nil Member.find_by_id(1)
end
end

View File

@@ -39,35 +39,4 @@ class VersionsControllerTest < Test::Unit::TestCase
assert_tag :tag => 'h2', :content => /1.0/
end
def test_get_edit
@request.session[:user_id] = 2
get :edit, :id => 2
assert_response :success
assert_template 'edit'
end
def test_post_edit
@request.session[:user_id] = 2
post :edit, :id => 2,
:version => { :name => 'New version name',
:effective_date => Date.today.strftime("%Y-%m-%d")}
assert_redirected_to 'projects/settings/1'
version = Version.find(2)
assert_equal 'New version name', version.name
assert_equal Date.today, version.effective_date
end
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 2
assert_redirected_to 'projects/settings/1'
assert_nil Version.find_by_id(2)
end
def test_issue_status_by
xhr :get, :status_by, :id => 2
assert_response :success
assert_template '_issue_counts'
end
end

View File

@@ -1,49 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'welcome_controller'
# Re-raise errors caught by the controller.
class WelcomeController; def rescue_action(e) raise e end; end
class WelcomeControllerTest < Test::Unit::TestCase
fixtures :projects, :news
def setup
@controller = WelcomeController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
end
def test_index
get :index
assert_response :success
assert_template 'index'
assert_not_nil assigns(:news)
assert_not_nil assigns(:projects)
assert !assigns(:projects).include?(Project.find(:first, :conditions => {:is_public => false}))
end
def test_browser_language
Setting.default_language = 'en'
@request.env['HTTP_ACCEPT_LANGUAGE'] = 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'
get :index
assert_equal :fr, @controller.current_language
end
end

View File

@@ -1,145 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'wiki_controller'
# Re-raise errors caught by the controller.
class WikiController; def rescue_action(e) raise e end; end
class WikiControllerTest < Test::Unit::TestCase
fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
@controller = WikiController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
end
def test_show_start_page
get :index, :id => 1
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /CookBook documentation/
end
def test_show_page_with_name
get :index, :id => 1, :page => 'Another_page'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /Another page/
end
def test_show_unexistent_page_without_edit_right
get :index, :id => 1, :page => 'Unexistent page'
assert_response 404
end
def test_show_unexistent_page_with_edit_right
@request.session[:user_id] = 2
get :index, :id => 1, :page => 'Unexistent page'
assert_response :success
assert_template 'edit'
end
def test_create_page
@request.session[:user_id] = 2
post :edit, :id => 1,
:page => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0}
assert_redirected_to 'wiki/1/New_page'
page = Project.find(1).wiki.find_page('New page')
assert !page.new_record?
assert_not_nil page.content
assert_equal 'Created the page', page.content.comments
end
def test_preview
@request.session[:user_id] = 2
xhr :post, :preview, :id => 1, :page => 'CookBook_documentation',
:content => { :comments => '',
:text => 'this is a *previewed text*',
:version => 3 }
assert_response :success
assert_template 'common/_preview'
assert_tag :tag => 'strong', :content => /previewed text/
end
def test_history
get :history, :id => 1, :page => 'CookBook_documentation'
assert_response :success
assert_template 'history'
assert_not_nil assigns(:versions)
assert_equal 3, assigns(:versions).size
end
def test_diff
get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1
assert_response :success
assert_template 'diff'
assert_tag :tag => 'span', :attributes => { :class => 'diff_in'},
:content => /updated/
end
def test_rename_with_redirect
@request.session[:user_id] = 2
post :rename, :id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => 1 }
assert_redirected_to 'wiki/1/Another_renamed_page'
wiki = Project.find(1).wiki
# Check redirects
assert_not_nil wiki.find_page('Another page')
assert_nil wiki.find_page('Another page', :with_redirect => false)
end
def test_rename_without_redirect
@request.session[:user_id] = 2
post :rename, :id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => "0" }
assert_redirected_to 'wiki/1/Another_renamed_page'
wiki = Project.find(1).wiki
# Check that there's no redirects
assert_nil wiki.find_page('Another page')
end
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1, :page => 'CookBook_documentation'
assert_redirected_to 'wiki/1/Page_index/special'
end
def test_page_index
get :special, :id => 1, :page => 'Page_index'
assert_response :success
assert_template 'special_page_index'
pages = assigns(:pages)
assert_not_nil pages
assert_equal 2, pages.size
assert_tag :tag => 'a', :attributes => { :href => '/wiki/1/CookBook_documentation' },
:content => /CookBook documentation/
end
def test_not_found
get :index, :id => 999
assert_response 404
end
end

View File

@@ -1,56 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'wikis_controller'
# Re-raise errors caught by the controller.
class WikisController; def rescue_action(e) raise e end; end
class WikisControllerTest < Test::Unit::TestCase
fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis
def setup
@controller = WikisController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
User.current = nil
end
def test_create
@request.session[:user_id] = 1
assert_nil Project.find(3).wiki
post :edit, :id => 3, :wiki => { :start_page => 'Start page' }
assert_response :success
wiki = Project.find(3).wiki
assert_not_nil wiki
assert_equal 'Start page', wiki.start_page
end
def test_destroy
@request.session[:user_id] = 1
post :destroy, :id => 1, :confirm => 1
assert_redirected_to 'projects/settings/1'
assert_nil Project.find(1).wiki
end
def test_not_found
@request.session[:user_id] = 1
post :destroy, :id => 999, :confirm => 1
assert_response 404
end
end

View File

@@ -1,41 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../../test_helper'
class ProjectsHelperTest < HelperTestCase
include ProjectsHelper
include ActionView::Helpers::TextHelper
fixtures :projects, :trackers, :issue_statuses, :issues, :enumerations, :users, :issue_categories
def setup
super
end
if Object.const_defined?(:Magick)
def test_gantt_image
assert gantt_image(Issue.find(:all, :conditions => "start_date IS NOT NULL AND due_date IS NOT NULL"), Date.today, 6, 2)
end
def test_gantt_image_with_days
assert gantt_image(Issue.find(:all, :conditions => "start_date IS NOT NULL AND due_date IS NOT NULL"), Date.today, 3, 4)
end
else
puts "RMagick not installed. Skipping tests !!!"
def test_fake; assert true end
end
end

View File

@@ -21,9 +21,8 @@ class RepositoryBazaarTest < Test::Unit::TestCase
fixtures :projects
# No '..' in the repository path
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/bazaar_repository'
REPOSITORY_PATH.gsub!(/\/+/, '/')
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + 'tmp/test/bazaar_repository'
def setup
@project = Project.find(1)
assert @repository = Repository::Bazaar.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}")
@@ -82,7 +81,7 @@ class RepositoryBazaarTest < Test::Unit::TestCase
assert_equal 'mkdir', annotate.lines[0]
end
else
puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!"
puts "Bazaar test repository NOT FOUND. Skipping tests !!!"
def test_fake; assert true end
end
end

View File

@@ -1,60 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
require 'pp'
class RepositoryCvsTest < Test::Unit::TestCase
fixtures :projects
# No '..' in the repository path
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository'
REPOSITORY_PATH.gsub!(/\//, "\\") if RUBY_PLATFORM =~ /mswin/
# CVS module
MODULE_NAME = 'test'
def setup
@project = Project.find(1)
assert @repository = Repository::Cvs.create(:project => @project,
:root_url => REPOSITORY_PATH,
:url => MODULE_NAME)
end
if File.directory?(REPOSITORY_PATH)
def test_fetch_changesets_from_scratch
@repository.fetch_changesets
@repository.reload
assert_equal 5, @repository.changesets.count
assert_equal 14, @repository.changes.count
assert_equal 'Two files changed', @repository.changesets.find_by_revision(3).comments
end
def test_fetch_changesets_incremental
@repository.fetch_changesets
# Remove changesets with revision > 2
@repository.changesets.find(:all, :conditions => 'revision > 2').each(&:destroy)
@repository.reload
assert_equal 2, @repository.changesets.count
@repository.fetch_changesets
assert_equal 5, @repository.changesets.count
end
else
puts "CVS test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end
end
end

View File

@@ -1,55 +0,0 @@
# redMine - project management software
# Copyright (C) 2006-2007 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 File.dirname(__FILE__) + '/../test_helper'
class RepositoryMercurialTest < Test::Unit::TestCase
fixtures :projects
# No '..' in the repository path
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/mercurial_repository'
def setup
@project = Project.find(1)
assert @repository = Repository::Mercurial.create(:project => @project, :url => REPOSITORY_PATH)
end
if File.directory?(REPOSITORY_PATH)
def test_fetch_changesets_from_scratch
@repository.fetch_changesets
@repository.reload
assert_equal 6, @repository.changesets.count
assert_equal 11, @repository.changes.count
assert_equal "Initial import.\nThe repository contains 3 files.", @repository.changesets.find_by_revision(0).comments
end
def test_fetch_changesets_incremental
@repository.fetch_changesets
# Remove changesets with revision > 2
@repository.changesets.find(:all, :conditions => 'revision > 2').each(&:destroy)
@repository.reload
assert_equal 3, @repository.changesets.count
@repository.fetch_changesets
assert_equal 6, @repository.changesets.count
end
else
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end
end
end

View File

@@ -49,7 +49,7 @@ class RepositorySubversionTest < Test::Unit::TestCase
assert_equal 8, @repository.changesets.count
end
else
puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"
puts "Subversion test repository NOT FOUND. Skipping tests !!!"
def test_fake; assert true end
end
end

View File

@@ -49,9 +49,6 @@ module Redmine
raise 'No date column defined defined.'
end
# Should we search custom fields on this model ?
searchable_options[:search_custom_fields] = !reflect_on_association(:custom_values).nil?
send :include, Redmine::Acts::Searchable::InstanceMethods
end
end
@@ -70,27 +67,11 @@ module Redmine
columns = searchable_options[:columns]
columns.slice!(1..-1) if options[:titles_only]
token_clauses = columns.collect {|column| "(LOWER(#{column}) LIKE ?)"}
if !options[:titles_only] && searchable_options[:search_custom_fields]
searchable_custom_field_ids = CustomField.find(:all,
:select => 'id',
:conditions => { :type => "#{self.name}CustomField",
:searchable => true }).collect(&:id)
if searchable_custom_field_ids.any?
custom_field_sql = "#{table_name}.id IN (SELECT customized_id FROM #{CustomValue.table_name}" +
" WHERE customized_type='#{self.name}' AND customized_id=#{table_name}.id AND LOWER(value) LIKE ?" +
" AND #{CustomValue.table_name}.custom_field_id IN (#{searchable_custom_field_ids.join(',')}))"
token_clauses << custom_field_sql
end
end
sql = ([token_clauses.join(' OR ')] * tokens.size).join(options[:all_words] ? ' AND ' : ' OR ')
sql = ([ '(' + columns.collect {|column| "(LOWER(#{column}) LIKE ?)"}.join(' OR ') + ')' ] * tokens.size).join(options[:all_words] ? ' AND ' : ' OR ')
if options[:offset]
sql = "(#{sql}) AND (#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')"
end
find_options[:conditions] = [sql, * (tokens * token_clauses.size).sort]
find_options[:conditions] = [sql, * (tokens * columns.size).sort]
results = with_scope(:find => {:conditions => ["#{searchable_options[:project_key]} = ?", project.id]}) do
find(:all, find_options)