Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63f11b1355 | ||
|
|
eb86e5e7e1 | ||
|
|
fc26668cd9 | ||
|
|
2b42e3fc50 | ||
|
|
b4eafd9ea8 | ||
|
|
2bcd448dda | ||
|
|
1af9c47a27 | ||
|
|
ea35fff5bf | ||
|
|
124ef65c1f | ||
|
|
361c50c1f4 | ||
|
|
27d6334afa | ||
|
|
963b1283c2 | ||
|
|
777edc13c1 | ||
|
|
d1a3fbea40 | ||
|
|
58610ec52a | ||
|
|
38b185f1dc | ||
|
|
e69631f26c | ||
|
|
47f399104b | ||
|
|
86319feef2 | ||
|
|
eb7cbd481e | ||
|
|
17c7886791 | ||
|
|
48949f979a | ||
|
|
86d756d22d | ||
|
|
ab4ff48abc | ||
|
|
63ef594033 | ||
|
|
bd8eded670 | ||
|
|
d5cc40c9b6 | ||
|
|
76ed8cc200 | ||
|
|
3539bef96b | ||
|
|
e29539df9c | ||
|
|
7e9c454478 |
@@ -48,7 +48,7 @@ class AdminController < ApplicationController
|
|||||||
def mail_options
|
def mail_options
|
||||||
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
|
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
|
||||||
if request.post?
|
if request.post?
|
||||||
settings = (params[:settings] || {}).dup
|
settings = (params[:settings] || {}).dup.symbolize_keys
|
||||||
settings[:notified_events] ||= []
|
settings[:notified_events] ||= []
|
||||||
settings.each { |name, value| Setting[name] = value }
|
settings.each { |name, value| Setting[name] = value }
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
|||||||
@@ -145,6 +145,19 @@ class ApplicationController < ActionController::Base
|
|||||||
self.class.read_inheritable_attribute('accept_key_auth_actions') || []
|
self.class.read_inheritable_attribute('accept_key_auth_actions') || []
|
||||||
end
|
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
|
# qvalues http header parser
|
||||||
# code taken from webrick
|
# code taken from webrick
|
||||||
def parse_qvalues(value)
|
def parse_qvalues(value)
|
||||||
|
|||||||
@@ -45,14 +45,8 @@ class DocumentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add_attachment
|
def add_attachment
|
||||||
# Save the attachments
|
attachments = attach_files(@document, params[:attachments])
|
||||||
@attachments = []
|
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('document_added')
|
||||||
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
|
redirect_to :action => 'show', :id => @document
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
@priorities = Enumeration::get_values('IPRI')
|
@priorities = Enumeration::get_values('IPRI')
|
||||||
|
@custom_values = []
|
||||||
if request.get?
|
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) }
|
@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
|
else
|
||||||
@@ -115,13 +116,8 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
def add_note
|
def add_note
|
||||||
journal = @issue.init_journal(User.current, params[:notes])
|
journal = @issue.init_journal(User.current, params[:notes])
|
||||||
params[:attachments].each { |file|
|
attachments = attach_files(@issue, params[:attachments])
|
||||||
next unless file.size > 0
|
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
|
||||||
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
|
if journal.save
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
|
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
|
||||||
@@ -139,15 +135,8 @@ class IssuesController < ApplicationController
|
|||||||
journal = @issue.init_journal(User.current, params[:notes])
|
journal = @issue.init_journal(User.current, params[:notes])
|
||||||
@issue.status = @new_status
|
@issue.status = @new_status
|
||||||
if @issue.update_attributes(params[:issue])
|
if @issue.update_attributes(params[:issue])
|
||||||
# Save attachments
|
attachments = attach_files(@issue, params[:attachments])
|
||||||
params[:attachments].each { |file|
|
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
|
||||||
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
|
# Log time
|
||||||
if current_role.allowed_to?(:log_time)
|
if current_role.allowed_to?(:log_time)
|
||||||
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
|
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ class MessagesController < ApplicationController
|
|||||||
@message.sticky = params[:message]['sticky']
|
@message.sticky = params[:message]['sticky']
|
||||||
end
|
end
|
||||||
if request.post? && @message.save
|
if request.post? && @message.save
|
||||||
params[:attachments].each { |file|
|
attach_files(@message, params[:attachments])
|
||||||
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
|
redirect_to :action => 'show', :id => @message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -56,9 +54,7 @@ class MessagesController < ApplicationController
|
|||||||
@reply.board = @board
|
@reply.board = @board
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
if !@reply.new_record?
|
if !@reply.new_record?
|
||||||
params[:attachments].each { |file|
|
attach_files(@reply, params[:attachments])
|
||||||
Attachment.create(:container => @reply, :file => file, :author => User.current) if file.size > 0
|
|
||||||
} if params[:attachments] and params[:attachments].is_a? Array
|
|
||||||
end
|
end
|
||||||
redirect_to :action => 'show', :id => @topic
|
redirect_to :action => 'show', :id => @topic
|
||||||
end
|
end
|
||||||
@@ -70,9 +66,7 @@ class MessagesController < ApplicationController
|
|||||||
@message.sticky = params[:message]['sticky']
|
@message.sticky = params[:message]['sticky']
|
||||||
end
|
end
|
||||||
if request.post? && @message.update_attributes(params[:message])
|
if request.post? && @message.update_attributes(params[:message])
|
||||||
params[:attachments].each { |file|
|
attach_files(@message, params[:attachments])
|
||||||
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)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :action => 'show', :id => @topic
|
redirect_to :action => 'show', :id => @topic
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -181,10 +181,7 @@ class ProjectsController < ApplicationController
|
|||||||
def add_document
|
def add_document
|
||||||
@document = @project.documents.build(params[:document])
|
@document = @project.documents.build(params[:document])
|
||||||
if request.post? and @document.save
|
if request.post? and @document.save
|
||||||
# Save the attachments
|
attach_files(@document, params[: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)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
|
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
|
||||||
redirect_to :action => 'list_documents', :id => @project
|
redirect_to :action => 'list_documents', :id => @project
|
||||||
@@ -237,10 +234,7 @@ 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]) }
|
@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
|
@issue.custom_values = @custom_values
|
||||||
if @issue.save
|
if @issue.save
|
||||||
if params[:attachments] && params[:attachments].is_a?(Array)
|
attach_files(@issue, params[:attachments])
|
||||||
# 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)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
||||||
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
|
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
|
||||||
@@ -345,14 +339,8 @@ class ProjectsController < ApplicationController
|
|||||||
def add_file
|
def add_file
|
||||||
if request.post?
|
if request.post?
|
||||||
@version = @project.versions.find_by_id(params[:version_id])
|
@version = @project.versions.find_by_id(params[:version_id])
|
||||||
# Save the attachments
|
attachments = attach_files(@version, params[:attachments])
|
||||||
@attachments = []
|
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
|
||||||
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
|
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||||
end
|
end
|
||||||
@versions = @project.versions.sort
|
@versions = @project.versions.sort
|
||||||
|
|||||||
@@ -92,6 +92,9 @@ class RepositoriesController < ApplicationController
|
|||||||
show_error and return unless @content
|
show_error and return unless @content
|
||||||
if 'raw' == params[:format]
|
if 'raw' == params[:format]
|
||||||
send_data @content, :filename => @path.split('/').last
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -109,12 +109,4 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
redirect_to :action => 'edit', :id => @user and return
|
redirect_to :action => 'edit', :id => @user and return
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -154,11 +154,7 @@ class WikiController < ApplicationController
|
|||||||
|
|
||||||
def add_attachment
|
def add_attachment
|
||||||
@page = @wiki.find_page(params[:page])
|
@page = @wiki.find_page(params[:page])
|
||||||
# Save the attachments
|
attach_files(@page, params[: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
|
redirect_to :action => 'index', :page => @page.title
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class WikisController < ApplicationController
|
|||||||
def edit
|
def edit
|
||||||
@wiki = @project.wiki || Wiki.new(:project => @project)
|
@wiki = @project.wiki || Wiki.new(:project => @project)
|
||||||
@wiki.attributes = params[:wiki]
|
@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'}
|
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -179,9 +179,9 @@ module ProjectsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
# today red line
|
# 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')
|
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)
|
gc.line(x, headers_heigth, x, headers_heigth + g_height-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ class AuthSource < ActiveRecord::Base
|
|||||||
|
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
validates_uniqueness_of :name
|
validates_uniqueness_of :name
|
||||||
validates_length_of :name, :host, :account_password, :maximum => 60
|
validates_length_of :name, :host, :maximum => 60
|
||||||
|
validates_length_of :account_password, :maximum => 60, :allow_nil => true
|
||||||
validates_length_of :account, :base_dn, :maximum => 255
|
validates_length_of :account, :base_dn, :maximum => 255
|
||||||
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30
|
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ class CustomField < ActiveRecord::Base
|
|||||||
def before_validation
|
def before_validation
|
||||||
# remove empty values
|
# remove empty values
|
||||||
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
|
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
|
end
|
||||||
|
|
||||||
def validate
|
def validate
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ class Project < ActiveRecord::Base
|
|||||||
conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
|
conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
|
||||||
end
|
end
|
||||||
conditions ||= ["#{Issue.table_name}.project_id = ?", id]
|
conditions ||= ["#{Issue.table_name}.project_id = ?", id]
|
||||||
Issue.with_scope :find => { :conditions => conditions } do
|
# Quick and dirty fix for Rails 2 compatibility
|
||||||
|
Issue.send(:with_scope, :find => { :conditions => conditions }) do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+6
-8
@@ -54,7 +54,6 @@ class Query < ActiveRecord::Base
|
|||||||
serialize :column_names
|
serialize :column_names
|
||||||
|
|
||||||
attr_protected :project, :user
|
attr_protected :project, :user
|
||||||
attr_accessor :executed_by
|
|
||||||
|
|
||||||
validates_presence_of :name, :on => :save
|
validates_presence_of :name, :on => :save
|
||||||
validates_length_of :name, :maximum => 255
|
validates_length_of :name, :maximum => 255
|
||||||
@@ -112,8 +111,7 @@ class Query < ActiveRecord::Base
|
|||||||
def initialize(attributes = nil)
|
def initialize(attributes = nil)
|
||||||
super attributes
|
super attributes
|
||||||
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
||||||
@executed_by = User.current.logged? ? User.current : nil
|
set_language_if_valid(User.current.language)
|
||||||
set_language_if_valid(executed_by.language) if executed_by
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate
|
def validate
|
||||||
@@ -145,12 +143,12 @@ class Query < ActiveRecord::Base
|
|||||||
"done_ratio" => { :type => :integer, :order => 13 }}
|
"done_ratio" => { :type => :integer, :order => 13 }}
|
||||||
|
|
||||||
user_values = []
|
user_values = []
|
||||||
user_values << ["<< #{l(:label_me)} >>", "me"] if executed_by
|
user_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
|
||||||
if project
|
if project
|
||||||
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
|
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
|
||||||
elsif executed_by
|
else
|
||||||
# members of the user's projects
|
# members of the user's projects
|
||||||
user_values += executed_by.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
|
user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
|
||||||
end
|
end
|
||||||
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?
|
@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?
|
@available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } unless user_values.empty?
|
||||||
@@ -267,7 +265,7 @@ class Query < ActiveRecord::Base
|
|||||||
elsif project
|
elsif project
|
||||||
clause << "#{Issue.table_name}.project_id=%d" % project.id
|
clause << "#{Issue.table_name}.project_id=%d" % project.id
|
||||||
else
|
else
|
||||||
clause << Project.visible_by(executed_by)
|
clause << Project.visible_by(User.current)
|
||||||
end
|
end
|
||||||
|
|
||||||
# filters clauses
|
# filters clauses
|
||||||
@@ -292,7 +290,7 @@ class Query < ActiveRecord::Base
|
|||||||
|
|
||||||
# "me" value subsitution
|
# "me" value subsitution
|
||||||
if %w(assigned_to_id author_id).include?(field)
|
if %w(assigned_to_id author_id).include?(field)
|
||||||
v.push(executed_by ? executed_by.id.to_s : "0") if v.delete("me")
|
v.push(User.current.logged? ? User.current.id.to_s : "0") if v.delete("me")
|
||||||
end
|
end
|
||||||
|
|
||||||
case operator_for field
|
case operator_for field
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ class WikiContent < ActiveRecord::Base
|
|||||||
|
|
||||||
acts_as_versioned
|
acts_as_versioned
|
||||||
class Version
|
class Version
|
||||||
belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
|
belongs_to :page, :class_name => '::WikiPage', :foreign_key => 'page_id'
|
||||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
belongs_to :author, :class_name => '::User', :foreign_key => 'author_id'
|
||||||
attr_protected :data
|
attr_protected :data
|
||||||
|
|
||||||
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},
|
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},
|
||||||
|
|||||||
@@ -7,21 +7,32 @@ function toggle_custom_field_format() {
|
|||||||
p_length = $("custom_field_min_length");
|
p_length = $("custom_field_min_length");
|
||||||
p_regexp = $("custom_field_regexp");
|
p_regexp = $("custom_field_regexp");
|
||||||
p_values = $("custom_field_possible_values");
|
p_values = $("custom_field_possible_values");
|
||||||
|
p_searchable = $("custom_field_searchable");
|
||||||
switch (format.value) {
|
switch (format.value) {
|
||||||
case "list":
|
case "list":
|
||||||
Element.hide(p_length.parentNode);
|
Element.hide(p_length.parentNode);
|
||||||
Element.hide(p_regexp.parentNode);
|
Element.hide(p_regexp.parentNode);
|
||||||
|
Element.show(p_searchable.parentNode);
|
||||||
Element.show(p_values);
|
Element.show(p_values);
|
||||||
break;
|
break;
|
||||||
case "date":
|
case "date":
|
||||||
case "bool":
|
case "bool":
|
||||||
Element.hide(p_length.parentNode);
|
Element.hide(p_length.parentNode);
|
||||||
Element.hide(p_regexp.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);
|
Element.hide(p_values);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Element.show(p_length.parentNode);
|
Element.show(p_length.parentNode);
|
||||||
Element.show(p_regexp.parentNode);
|
Element.show(p_regexp.parentNode);
|
||||||
|
Element.show(p_searchable.parentNode);
|
||||||
Element.hide(p_values);
|
Element.hide(p_values);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -47,7 +58,6 @@ function deleteValueField(e) {
|
|||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--[form:custom_field]-->
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<p><%= f.text_field :name, :required => true %></p>
|
<p><%= f.text_field :name, :required => true %></p>
|
||||||
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
||||||
@@ -59,11 +69,8 @@ function deleteValueField(e) {
|
|||||||
<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
|
<% (@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>
|
<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<%= javascript_tag "toggle_custom_field_format();" %>
|
|
||||||
<!--[eoform:custom_field]-->
|
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<% case @custom_field.type.to_s
|
<% case @custom_field.type.to_s
|
||||||
@@ -78,6 +85,7 @@ when "IssueCustomField" %>
|
|||||||
<p><%= f.check_box :is_required %></p>
|
<p><%= f.check_box :is_required %></p>
|
||||||
<p><%= f.check_box :is_for_all %></p>
|
<p><%= f.check_box :is_for_all %></p>
|
||||||
<p><%= f.check_box :is_filter %></p>
|
<p><%= f.check_box :is_filter %></p>
|
||||||
|
<p><%= f.check_box :searchable %></p>
|
||||||
|
|
||||||
<% when "UserCustomField" %>
|
<% when "UserCustomField" %>
|
||||||
<p><%= f.check_box :is_required %></p>
|
<p><%= f.check_box :is_required %></p>
|
||||||
@@ -87,3 +95,4 @@ when "IssueCustomField" %>
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<%= javascript_tag "toggle_custom_field_format();" %>
|
||||||
|
|||||||
@@ -30,16 +30,17 @@
|
|||||||
<div class="contextual">
|
<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' %>
|
<%= 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>
|
</div>
|
||||||
<%= simple_format(auto_link(h(comment.comments)))%>
|
<%= textilizable(comment.comments) %>
|
||||||
<% end if @news.comments_count > 0 %>
|
<% end if @news.comments_count > 0 %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if authorize_for 'news', 'add_comment' %>
|
<% if authorize_for 'news', 'add_comment' %>
|
||||||
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
|
<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 %>
|
<% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
|
||||||
<%= text_area 'comment', 'comments', :cols => 60, :rows => 6 %>
|
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||||
|
<%= wikitoolbar_for 'comment_comments' %>
|
||||||
<p><%= submit_tag l(:button_add) %></p>
|
<p><%= submit_tag l(:button_add) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% set_html_title h(@news.title) -%>
|
<% set_html_title(h(@news.title)) -%>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% line_num += 1 %>
|
<% line_num += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% line_num += 1 %>
|
<% line_num += 1 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
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
|
||||||
+25
-2
@@ -5,6 +5,29 @@ Copyright (C) 2006-2007 Jean-Philippe Lang
|
|||||||
http://www.redmine.org/
|
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
|
== 2007-12-10 v0.6.1
|
||||||
|
|
||||||
* Rails 2.0 compatibility
|
* Rails 2.0 compatibility
|
||||||
@@ -26,7 +49,7 @@ http://www.redmine.org/
|
|||||||
* Diff style (inline or side by side) automatically saved as a user preference
|
* 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 issues status changes on the activity view (by Cyril Mougel)
|
||||||
* Added forums topics on the activity view (disabled by default)
|
* 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 don't want to be notified of changes that they make
|
||||||
* Trac importer now supports mysql and postgresql databases
|
* Trac importer now supports mysql and postgresql databases
|
||||||
* Trac importer improvements (by Mat Trudel)
|
* Trac importer improvements (by Mat Trudel)
|
||||||
* 'fixed version' field can now be displayed on the issue list
|
* 'fixed version' field can now be displayed on the issue list
|
||||||
@@ -61,7 +84,7 @@ http://www.redmine.org/
|
|||||||
* Fixed: admin should be able to move issues to any project
|
* 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: adding an attachment is not possible when changing the status of an issue
|
||||||
* Fixed: No mime-types in documents/files downloading
|
* 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 there's only one board for the project
|
||||||
* Fixed: 'me' doesn't appear in the drop down filters on a project issue list.
|
* Fixed: 'me' doesn't appear in the drop down filters on a project issue list.
|
||||||
|
|
||||||
== 2007-11-04 v0.6.0
|
== 2007-11-04 v0.6.0
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ Subversion
|
|||||||
svnadmin create tmp/test/subversion_repository
|
svnadmin create tmp/test/subversion_repository
|
||||||
gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load 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
|
Bazaar
|
||||||
------
|
------
|
||||||
gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test
|
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
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ $quiet = false
|
|||||||
$redmine_host = ''
|
$redmine_host = ''
|
||||||
$repos_base = ''
|
$repos_base = ''
|
||||||
$svn_owner = 'root'
|
$svn_owner = 'root'
|
||||||
|
$use_groupid = true
|
||||||
$svn_url = false
|
$svn_url = false
|
||||||
$test = false
|
$test = false
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ begin
|
|||||||
case opt
|
case opt
|
||||||
when '--svn-dir'; $repos_base = arg.dup
|
when '--svn-dir'; $repos_base = arg.dup
|
||||||
when '--redmine-host'; $redmine_host = arg.dup
|
when '--redmine-host'; $redmine_host = arg.dup
|
||||||
when '--owner'; $svn_owner = arg.dup
|
when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
|
||||||
when '--url'; $svn_url = arg.dup
|
when '--url'; $svn_url = arg.dup
|
||||||
when '--verbose'; $verbose += 1
|
when '--verbose'; $verbose += 1
|
||||||
when '--test'; $test = true
|
when '--test'; $test = true
|
||||||
@@ -144,7 +145,7 @@ def set_owner_and_rights(project, repos_path, &block)
|
|||||||
if RUBY_PLATFORM =~ /mswin/
|
if RUBY_PLATFORM =~ /mswin/
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
else
|
else
|
||||||
uid, gid = Etc.getpwnam($svn_owner).uid, Etc.getgrnam(project.identifier).gid
|
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : 0)
|
||||||
right = project.is_public ? 0775 : 0770
|
right = project.is_public ? 0775 : 0770
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
Find.find(repos_path) do |f|
|
Find.find(repos_path) do |f|
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Muss mindestens %d Zeichen lang sein.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ field_redirect_existing_links: Redirect existing links
|
|||||||
field_estimated_hours: Estimated time
|
field_estimated_hours: Estimated time
|
||||||
field_column_names: Columns
|
field_column_names: Columns
|
||||||
field_time_zone: Time zone
|
field_time_zone: Time zone
|
||||||
|
field_searchable: Searchable
|
||||||
|
|
||||||
setting_app_title: Application title
|
setting_app_title: Application title
|
||||||
setting_app_subtitle: Application subtitle
|
setting_app_subtitle: Application subtitle
|
||||||
|
|||||||
@@ -552,3 +552,4 @@ setting_time_format: Formato de hora
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ field_redirect_existing_links: Rediriger les liens existants
|
|||||||
field_estimated_hours: Temps estimé
|
field_estimated_hours: Temps estimé
|
||||||
field_column_names: Colonnes
|
field_column_names: Colonnes
|
||||||
field_time_zone: Fuseau horaire
|
field_time_zone: Fuseau horaire
|
||||||
|
field_searchable: Utilisé pour les recherches
|
||||||
|
|
||||||
setting_app_title: Titre de l'application
|
setting_app_title: Titre de l'application
|
||||||
setting_app_subtitle: Sous-titre de l'application
|
setting_app_subtitle: Sous-titre de l'application
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
+41
-40
@@ -72,13 +72,13 @@ notice_locking_conflict: 別のユーザがデータを更新しています。
|
|||||||
notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。
|
notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。
|
||||||
notice_not_authorized: このページにアクセスするには認証が必要です。
|
notice_not_authorized: このページにアクセスするには認証が必要です。
|
||||||
notice_email_sent: %s宛にメールを送信しました。
|
notice_email_sent: %s宛にメールを送信しました。
|
||||||
notice_email_error: メール送信中にエラーが発生しました (%s)
|
notice_email_error: メール送信中にエラーが発生しました(%s)
|
||||||
notice_feeds_access_key_reseted: RSSアクセスキーを初期化しました。
|
notice_feeds_access_key_reseted: RSSアクセスキーを初期化しました。
|
||||||
|
|
||||||
mail_subject_lost_password: redMineパスワード
|
mail_subject_lost_password: Redmineパスワード
|
||||||
mail_body_lost_password: 'パスワードを変更するには、以下のリンクをたどってください:'
|
mail_body_lost_password: 'パスワードを変更するには、以下のリンクをたどってください:'
|
||||||
mail_subject_register: redMineアカウントが有効になりました
|
mail_subject_register: Redmineアカウントが有効になりました
|
||||||
mail_body_register: 'Redmine アカウントをアクティブにするには、以下のリンクをたどってください:'
|
mail_body_register: 'Redmineアカウントをアクティブにするには、以下のリンクをたどってください:'
|
||||||
|
|
||||||
gui_validation_error: 1件のエラー
|
gui_validation_error: 1件のエラー
|
||||||
gui_validation_error_plural: %d件のエラー
|
gui_validation_error_plural: %d件のエラー
|
||||||
@@ -159,8 +159,8 @@ field_identifier: 識別子
|
|||||||
field_is_filter: フィルタとして使う
|
field_is_filter: フィルタとして使う
|
||||||
field_issue_to_id: 関連する問題
|
field_issue_to_id: 関連する問題
|
||||||
field_delay: 遅延
|
field_delay: 遅延
|
||||||
field_assignable: Issues can be assigned to this role
|
field_assignable: 問題はこのロールに割り当てることができます
|
||||||
field_redirect_existing_links: Redirect existing links
|
field_redirect_existing_links: 既存のリンクをリダイレクトする
|
||||||
field_estimated_hours: 予定工数
|
field_estimated_hours: 予定工数
|
||||||
|
|
||||||
setting_app_title: アプリケーションのタイトル
|
setting_app_title: アプリケーションのタイトル
|
||||||
@@ -410,18 +410,18 @@ label_message_last: 最新のメッセージ
|
|||||||
label_message_new: 新しいメッセージ
|
label_message_new: 新しいメッセージ
|
||||||
label_reply_plural: 返答
|
label_reply_plural: 返答
|
||||||
label_send_information: アカウント情報をユーザに送信
|
label_send_information: アカウント情報をユーザに送信
|
||||||
label_year: Year
|
label_year: 年
|
||||||
label_month: Month
|
label_month: 月
|
||||||
label_week: Week
|
label_week: 週
|
||||||
label_date_from: From
|
label_date_from: から
|
||||||
label_date_to: To
|
label_date_to: まで
|
||||||
label_language_based: 既定の言語の設定に従う
|
label_language_based: 既定の言語の設定に従う
|
||||||
label_sort_by: Sort by %s
|
label_sort_by: %sで並び替え
|
||||||
label_send_test_email: テストメールを送信
|
label_send_test_email: テストメールを送信
|
||||||
label_feeds_access_key_created_on: RSS access key created %s ago
|
label_feeds_access_key_created_on: RSSアクセスキーは%s前に作成されました
|
||||||
label_module_plural: Modules
|
label_module_plural: モジュール
|
||||||
label_added_time_by: Added by %s %s ago
|
label_added_time_by: %sが%s前に追加しました
|
||||||
label_updated_time: Updated %s ago
|
label_updated_time: %s前に更新されました
|
||||||
label_jump_to_a_project: プロジェクトへ移動...
|
label_jump_to_a_project: プロジェクトへ移動...
|
||||||
|
|
||||||
button_login: ログイン
|
button_login: ログイン
|
||||||
@@ -454,8 +454,8 @@ button_unwatch: ウォッチをやめる
|
|||||||
button_reply: 返答
|
button_reply: 返答
|
||||||
button_archive: 書庫に保存
|
button_archive: 書庫に保存
|
||||||
button_unarchive: 書庫から戻す
|
button_unarchive: 書庫から戻す
|
||||||
button_reset: Reset
|
button_reset: リセット
|
||||||
button_rename: Rename
|
button_rename: 名前変更
|
||||||
|
|
||||||
status_active: 有効
|
status_active: 有効
|
||||||
status_registered: 登録
|
status_registered: 登録
|
||||||
@@ -482,10 +482,10 @@ text_comma_separated: (カンマで区切った)複数の値が使えます
|
|||||||
text_issues_ref_in_commit_messages: コミットメッセージ内で問題の参照/修正
|
text_issues_ref_in_commit_messages: コミットメッセージ内で問題の参照/修正
|
||||||
text_issue_added: 問題 %s が報告されました。
|
text_issue_added: 問題 %s が報告されました。
|
||||||
text_issue_updated: 問題 %s が更新されました。
|
text_issue_updated: 問題 %s が更新されました。
|
||||||
text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content ?
|
text_wiki_destroy_confirmation: 本当にこのwikiとその内容の全てを削除しますか?
|
||||||
text_issue_category_destroy_question: Some issues (%d) are assigned to this category. What do you want to do ?
|
text_issue_category_destroy_question: このカテゴリに割り当て済みの問題(%d)があります。何をしようとしていますか?
|
||||||
text_issue_category_destroy_assignments: Remove category assignments
|
text_issue_category_destroy_assignments: カテゴリの割り当てを削除する
|
||||||
text_issue_category_reassign_to: Reassing issues to this category
|
text_issue_category_reassign_to: 問題をこのカテゴリに再割り当てする
|
||||||
|
|
||||||
default_role_manager: 管理者
|
default_role_manager: 管理者
|
||||||
default_role_developper: 開発者
|
default_role_developper: 開発者
|
||||||
@@ -512,8 +512,8 @@ default_activity_development: 開発作業
|
|||||||
enumeration_issue_priorities: 問題の優先度
|
enumeration_issue_priorities: 問題の優先度
|
||||||
enumeration_doc_categories: 文書カテゴリ
|
enumeration_doc_categories: 文書カテゴリ
|
||||||
enumeration_activities: 作業分類 (時間トラッキング)
|
enumeration_activities: 作業分類 (時間トラッキング)
|
||||||
label_file_plural: Files
|
label_file_plural: ファイル
|
||||||
label_changeset_plural: Changesets
|
label_changeset_plural: チェンジセット
|
||||||
field_column_names: 項目
|
field_column_names: 項目
|
||||||
label_default_columns: 既定の項目
|
label_default_columns: 既定の項目
|
||||||
setting_issue_list_default_columns: 問題の一覧で表示する項目
|
setting_issue_list_default_columns: 問題の一覧で表示する項目
|
||||||
@@ -534,19 +534,20 @@ label_user_mail_option_none: "ウォッチまたは関係している問題の
|
|||||||
setting_emails_footer: メールのフッタ
|
setting_emails_footer: メールのフッタ
|
||||||
label_float: 小数
|
label_float: 小数
|
||||||
button_copy: コピー
|
button_copy: コピー
|
||||||
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
mail_body_account_information_external: 「%s」アカウントを使ってRedmineにログインできます。
|
||||||
mail_body_account_information: Your Redmine account information
|
mail_body_account_information: Redmineアカウント情報
|
||||||
setting_protocol: Protocol
|
setting_protocol: プロトコル
|
||||||
label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
|
label_user_mail_no_self_notified: 自分自身による変更の通知は不要です
|
||||||
setting_time_format: Time format
|
setting_time_format: 時刻の形式
|
||||||
label_registration_activation_by_email: account activation by email
|
label_registration_activation_by_email: メールでアカウントを有効化
|
||||||
mail_subject_account_activation_request: Redmine account activation request
|
mail_subject_account_activation_request: Redminアカウントの有効化要求
|
||||||
mail_body_account_activation_request: 'A new user (%s) has registered. His account his pending your approval:'
|
mail_body_account_activation_request: 新しいユーザ(%s)が登録しています。このアカウントはあなたの承認待ちです:
|
||||||
label_registration_automatic_activation: automatic account activation
|
label_registration_automatic_activation: 自動でアカウントを有効化
|
||||||
label_registration_manual_activation: manual account activation
|
label_registration_manual_activation: 手動でアカウントを有効化
|
||||||
notice_account_pending: "Your account was created and is now pending administrator approval."
|
notice_account_pending: アカウントは作成済みで、管理者の承認待ちです。
|
||||||
field_time_zone: Time zone
|
field_time_zone: タイムゾーン
|
||||||
text_caracters_minimum: Must be at least %d characters long.
|
text_caracters_minimum: 最低%d文字の長さが必要です
|
||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: ブラインドカーボンコピーで受信(bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: 注釈
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: %s別の問題
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Musi być nie krótsze niż %d znaków.
|
|||||||
setting_bcc_recipients: Odbiorcy kopii tajnej (kt/bcc)
|
setting_bcc_recipients: Odbiorcy kopii tajnej (kt/bcc)
|
||||||
button_annotate: Adnotuj
|
button_annotate: Adnotuj
|
||||||
label_issues_by: Zagadnienia wprowadzone przez %s
|
label_issues_by: Zagadnienia wprowadzone przez %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
+34
-33
@@ -5,8 +5,8 @@ actionview_datehelper_select_month_names: 一月,二月,三月,四月,五月,六
|
|||||||
actionview_datehelper_select_month_names_abbr: 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月
|
actionview_datehelper_select_month_names_abbr: 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月
|
||||||
actionview_datehelper_select_month_prefix:
|
actionview_datehelper_select_month_prefix:
|
||||||
actionview_datehelper_select_year_prefix:
|
actionview_datehelper_select_year_prefix:
|
||||||
actionview_datehelper_time_in_words_day: 1 日
|
actionview_datehelper_time_in_words_day: 1 天
|
||||||
actionview_datehelper_time_in_words_day_plural: %d 日
|
actionview_datehelper_time_in_words_day_plural: %d 天
|
||||||
actionview_datehelper_time_in_words_hour_about: 約 1 小時
|
actionview_datehelper_time_in_words_hour_about: 約 1 小時
|
||||||
actionview_datehelper_time_in_words_hour_about_plural: 約 %d 小時
|
actionview_datehelper_time_in_words_hour_about_plural: 約 %d 小時
|
||||||
actionview_datehelper_time_in_words_hour_about_single: 約 1 小時
|
actionview_datehelper_time_in_words_hour_about_single: 約 1 小時
|
||||||
@@ -46,10 +46,10 @@ general_text_No: 'No'
|
|||||||
general_text_Yes: 'Yes'
|
general_text_Yes: 'Yes'
|
||||||
general_text_no: 'no'
|
general_text_no: 'no'
|
||||||
general_text_yes: 'yes'
|
general_text_yes: 'yes'
|
||||||
general_lang_name: 'Traditional Chinese (繁體中文)'
|
general_lang_name: 'Chinese (繁體中文)'
|
||||||
general_csv_separator: ','
|
general_csv_separator: ','
|
||||||
general_csv_encoding: ISO-8859-1
|
general_csv_encoding: Big5
|
||||||
general_pdf_encoding: big5
|
general_pdf_encoding: Big5
|
||||||
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日
|
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日
|
||||||
general_first_day_of_week: '7'
|
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_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_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_account_activated: Your account has been activated. You can now log in.
|
||||||
notice_successful_create: Successful creation.
|
notice_successful_create: 建立成功
|
||||||
notice_successful_update: Successful update.
|
notice_successful_update: 更新成功
|
||||||
notice_successful_delete: Successful deletion.
|
notice_successful_delete: 刪除成功
|
||||||
notice_successful_connection: Successful connection.
|
notice_successful_connection: Successful connection.
|
||||||
notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
|
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.
|
notice_locking_conflict: Data have been updated by another user.
|
||||||
@@ -122,7 +122,7 @@ field_subject: 主旨
|
|||||||
field_due_date: 完成日期
|
field_due_date: 完成日期
|
||||||
field_assigned_to: 分派給
|
field_assigned_to: 分派給
|
||||||
field_priority: 重要性
|
field_priority: 重要性
|
||||||
field_fixed_version: Fixed version
|
field_fixed_version: 版本
|
||||||
field_user: 用戶
|
field_user: 用戶
|
||||||
field_role: 角色
|
field_role: 角色
|
||||||
field_homepage: 網站首頁
|
field_homepage: 網站首頁
|
||||||
@@ -151,21 +151,21 @@ field_attr_lastname: Lastname attribute
|
|||||||
field_attr_mail: Email attribute
|
field_attr_mail: Email attribute
|
||||||
field_onthefly: On-the-fly user creation
|
field_onthefly: On-the-fly user creation
|
||||||
field_start_date: 開始日期
|
field_start_date: 開始日期
|
||||||
field_done_ratio: %% 已完成
|
field_done_ratio: 完成百分比
|
||||||
field_auth_source: 認證模式
|
field_auth_source: 認證模式
|
||||||
field_hide_mail: 隱藏我的電子郵件
|
field_hide_mail: 隱藏我的電子郵件
|
||||||
field_comments: 註解
|
field_comments: 註解
|
||||||
field_url: URL
|
field_url: URL
|
||||||
field_start_page: Start page
|
field_start_page: 首頁
|
||||||
field_subproject: 子專案
|
field_subproject: 子專案
|
||||||
field_hours: 小時
|
field_hours: 小時
|
||||||
field_activity: Activity
|
field_activity: 活動
|
||||||
field_spent_on: 日期
|
field_spent_on: 日期
|
||||||
field_identifier: 代碼
|
field_identifier: 代碼
|
||||||
field_is_filter: Used as a filter
|
field_is_filter: Used as a filter
|
||||||
field_issue_to_id: Related issue
|
field_issue_to_id: Related issue
|
||||||
field_delay: 逾期
|
field_delay: 逾期
|
||||||
field_assignable: Issues can be assigned to this role
|
field_assignable: 項目可被分派至此角色
|
||||||
field_redirect_existing_links: Redirect existing links
|
field_redirect_existing_links: Redirect existing links
|
||||||
field_estimated_hours: 預估工時
|
field_estimated_hours: 預估工時
|
||||||
field_column_names: Columns
|
field_column_names: Columns
|
||||||
@@ -304,9 +304,9 @@ label_open_issues: 進行中
|
|||||||
label_open_issues_plural: 進行中
|
label_open_issues_plural: 進行中
|
||||||
label_closed_issues: 已結束
|
label_closed_issues: 已結束
|
||||||
label_closed_issues_plural: 已結束
|
label_closed_issues_plural: 已結束
|
||||||
label_total: Total
|
label_total: 總計
|
||||||
label_permissions: 權限
|
label_permissions: 權限
|
||||||
label_current_status: Current status
|
label_current_status: 目前狀態
|
||||||
label_new_statuses_allowed: New statuses allowed
|
label_new_statuses_allowed: New statuses allowed
|
||||||
label_all: 全部
|
label_all: 全部
|
||||||
label_none: 空值
|
label_none: 空值
|
||||||
@@ -314,11 +314,11 @@ label_nobody: nobody
|
|||||||
label_next: Next
|
label_next: Next
|
||||||
label_previous: Previous
|
label_previous: Previous
|
||||||
label_used_by: Used by
|
label_used_by: Used by
|
||||||
label_details: Details
|
label_details: 明細
|
||||||
label_add_note: 加入一個新筆記
|
label_add_note: 加入一個新筆記
|
||||||
label_per_page: 每頁
|
label_per_page: 每頁
|
||||||
label_calendar: 日曆
|
label_calendar: 日曆
|
||||||
label_months_from: months from
|
label_months_from: 個月, 開始月份
|
||||||
label_gantt: 甘特圖
|
label_gantt: 甘特圖
|
||||||
label_internal: Internal
|
label_internal: Internal
|
||||||
label_last_changes: 最近 %d 個變更
|
label_last_changes: 最近 %d 個變更
|
||||||
@@ -360,7 +360,7 @@ label_latest_revision: 最新版次
|
|||||||
label_latest_revision_plural: 最近版次清單
|
label_latest_revision_plural: 最近版次清單
|
||||||
label_view_revisions: 檢視版次清單
|
label_view_revisions: 檢視版次清單
|
||||||
label_max_size: 最大長度
|
label_max_size: 最大長度
|
||||||
label_on: 'on'
|
label_on: 總共
|
||||||
label_sort_highest: 移動至開頭
|
label_sort_highest: 移動至開頭
|
||||||
label_sort_higher: 往上移動
|
label_sort_higher: 往上移動
|
||||||
label_sort_lower: 往下移動
|
label_sort_lower: 往下移動
|
||||||
@@ -368,7 +368,7 @@ label_sort_lowest: 移動至結尾
|
|||||||
label_roadmap: 版本藍圖
|
label_roadmap: 版本藍圖
|
||||||
label_roadmap_due_in: 倒數天數:
|
label_roadmap_due_in: 倒數天數:
|
||||||
label_roadmap_overdue: %s 逾期
|
label_roadmap_overdue: %s 逾期
|
||||||
label_roadmap_no_issues: No issues for this version
|
label_roadmap_no_issues: 此版本尚未包含任何項目
|
||||||
label_search: 搜尋
|
label_search: 搜尋
|
||||||
label_result_plural: 結果
|
label_result_plural: 結果
|
||||||
label_all_words: All words
|
label_all_words: All words
|
||||||
@@ -382,13 +382,13 @@ label_index_by_date: 依日期索引
|
|||||||
label_current_version: 現行版本
|
label_current_version: 現行版本
|
||||||
label_preview: 預覽
|
label_preview: 預覽
|
||||||
label_feed_plural: Feeds
|
label_feed_plural: Feeds
|
||||||
label_changes_details: Details of all changes
|
label_changes_details: 所有變更的明細
|
||||||
label_issue_tracking: 項目追蹤
|
label_issue_tracking: 項目追蹤
|
||||||
label_spent_time: 耗用時間
|
label_spent_time: 耗用時間
|
||||||
label_f_hour: %.2f hour
|
label_f_hour: %.2f 小時
|
||||||
label_f_hour_plural: %.2f hours
|
label_f_hour_plural: %.2f 小時
|
||||||
label_time_tracking: Time tracking
|
label_time_tracking: Time tracking
|
||||||
label_change_plural: Changes
|
label_change_plural: 變更
|
||||||
label_statistics: Statistics
|
label_statistics: Statistics
|
||||||
label_commits_per_month: Commits per month
|
label_commits_per_month: Commits per month
|
||||||
label_commits_per_author: Commits per author
|
label_commits_per_author: Commits per author
|
||||||
@@ -405,11 +405,11 @@ label_loading: 載入中...
|
|||||||
label_relation_new: 建立新關聯
|
label_relation_new: 建立新關聯
|
||||||
label_relation_delete: 刪除關聯
|
label_relation_delete: 刪除關聯
|
||||||
label_relates_to: 關聯至
|
label_relates_to: 關聯至
|
||||||
label_duplicates: duplicates
|
label_duplicates: 已重複
|
||||||
label_blocks: blocks
|
label_blocks: 阻擋
|
||||||
label_blocked_by: blocked by
|
label_blocked_by: 被阻擋
|
||||||
label_precedes: precedes
|
label_precedes: 優先於
|
||||||
label_follows: follows
|
label_follows: 跟隨於
|
||||||
label_end_to_start: end to start
|
label_end_to_start: end to start
|
||||||
label_end_to_end: end to end
|
label_end_to_end: end to end
|
||||||
label_start_to_start: start to start
|
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_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_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_workflow_edit: Select a role and a tracker to edit the workflow
|
||||||
text_are_you_sure: Are you sure ?
|
text_are_you_sure: 確定執行?
|
||||||
text_journal_changed: changed from %s to %s
|
text_journal_changed: 從 %s 變更為 %s
|
||||||
text_journal_set_to: set to %s
|
text_journal_set_to: 設定為 %s
|
||||||
text_journal_deleted: deleted
|
text_journal_deleted: deleted
|
||||||
text_tip_task_begin_day: task beginning this day
|
text_tip_task_begin_day: task beginning this day
|
||||||
text_tip_task_end_day: task ending this day
|
text_tip_task_end_day: task ending this day
|
||||||
@@ -541,11 +541,12 @@ default_doc_category_tech: 技術文件
|
|||||||
default_priority_low: 低
|
default_priority_low: 低
|
||||||
default_priority_normal: 正常
|
default_priority_normal: 正常
|
||||||
default_priority_high: 高
|
default_priority_high: 高
|
||||||
default_priority_urgent: 急
|
default_priority_urgent: 速
|
||||||
default_priority_immediate: 特急
|
default_priority_immediate: 急
|
||||||
default_activity_design: 設計
|
default_activity_design: 設計
|
||||||
default_activity_development: 開發
|
default_activity_development: 開發
|
||||||
|
|
||||||
enumeration_issue_priorities: 項目重要性
|
enumeration_issue_priorities: 項目重要性
|
||||||
enumeration_doc_categories: 文件分類
|
enumeration_doc_categories: 文件分類
|
||||||
enumeration_activities: 活動 (time tracking)
|
enumeration_activities: 活動 (time tracking)
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -552,3 +552,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
|||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
button_annotate: Annotate
|
button_annotate: Annotate
|
||||||
label_issues_by: Issues by %s
|
label_issues_by: Issues by %s
|
||||||
|
field_searchable: Searchable
|
||||||
|
|||||||
@@ -112,9 +112,15 @@ module Redmine
|
|||||||
|
|
||||||
def shellout(cmd, &block)
|
def shellout(cmd, &block)
|
||||||
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
|
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
|
||||||
IO.popen(cmd, "r+") do |io|
|
begin
|
||||||
io.close_write
|
IO.popen(cmd, "r+") do |io|
|
||||||
block.call(io) if block_given?
|
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
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
info
|
info
|
||||||
rescue Errno::ENOENT => e
|
rescue CommandFailed
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -81,8 +81,6 @@ module Redmine
|
|||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
||||||
entries.sort_by_name
|
entries.sort_by_name
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||||
@@ -144,8 +142,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
revisions
|
revisions
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||||
@@ -164,8 +160,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
#return nil if $? && $?.exitstatus != 0
|
#return nil if $? && $?.exitstatus != 0
|
||||||
DiffTableList.new diff, type
|
DiffTableList.new diff, type
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
@@ -179,8 +173,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
cat
|
cat
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
@@ -198,8 +190,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
blame
|
blame
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
entries.sort_by_name
|
entries.sort_by_name
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
STARTLOG="----------------------------"
|
STARTLOG="----------------------------"
|
||||||
@@ -234,8 +232,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||||
@@ -250,8 +246,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
DiffTableList.new diff, type
|
DiffTableList.new diff, type
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
@@ -265,8 +259,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
cat
|
cat
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
@@ -283,8 +275,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
blame
|
blame
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -70,8 +70,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
entries.sort_by_name
|
entries.sort_by_name
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||||
@@ -99,8 +97,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
revisions
|
revisions
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||||
@@ -117,8 +113,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
DiffTableList.new diff, type
|
DiffTableList.new diff, type
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -154,7 +148,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
paths
|
paths
|
||||||
rescue Errno::ENOENT => e
|
rescue CommandFailed
|
||||||
paths
|
paths
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ module Redmine
|
|||||||
:lastrev => revisions(nil,nil,nil,{:limit => 1}).last
|
:lastrev => revisions(nil,nil,nil,{:limit => 1}).last
|
||||||
})
|
})
|
||||||
info
|
info
|
||||||
rescue Errno::ENOENT => e
|
rescue CommandFailed
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -58,8 +58,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
entries.sort_by_name
|
entries.sort_by_name
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def entry(path=nil, identifier=nil)
|
def entry(path=nil, identifier=nil)
|
||||||
@@ -119,8 +117,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
revisions
|
revisions
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||||
@@ -140,9 +136,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
DiffTableList.new diff, type
|
DiffTableList.new diff, type
|
||||||
|
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
@@ -154,8 +147,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
cat
|
cat
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
@@ -173,8 +164,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
blame
|
blame
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
info
|
info
|
||||||
rescue Errno::ENOENT => e
|
rescue CommandFailed
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -91,8 +91,6 @@ module Redmine
|
|||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
||||||
entries.sort_by_name
|
entries.sort_by_name
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||||
@@ -130,8 +128,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
revisions
|
revisions
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||||
@@ -154,8 +150,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
DiffTableList.new diff, type
|
DiffTableList.new diff, type
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def cat(path, identifier=nil)
|
def cat(path, identifier=nil)
|
||||||
@@ -169,8 +163,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
cat
|
cat
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def annotate(path, identifier=nil)
|
def annotate(path, identifier=nil)
|
||||||
@@ -186,8 +178,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
blame
|
blame
|
||||||
rescue Errno::ENOENT => e
|
|
||||||
raise CommandFailed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Redmine
|
|||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 6
|
MINOR = 6
|
||||||
TINY = 1
|
TINY = 3
|
||||||
|
|
||||||
def self.revision
|
def self.revision
|
||||||
revision = nil
|
revision = nil
|
||||||
|
|||||||
@@ -145,6 +145,11 @@ namespace :redmine do
|
|||||||
|
|
||||||
class TracWikiPage < ActiveRecord::Base
|
class TracWikiPage < ActiveRecord::Base
|
||||||
set_table_name :wiki
|
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
|
end
|
||||||
|
|
||||||
class TracPermission < ActiveRecord::Base
|
class TracPermission < ActiveRecord::Base
|
||||||
|
|||||||
Vendored
+3
-2
@@ -11,16 +11,17 @@ custom_fields_001:
|
|||||||
is_required: false
|
is_required: false
|
||||||
field_format: list
|
field_format: list
|
||||||
custom_fields_002:
|
custom_fields_002:
|
||||||
name: Build
|
name: Searchable field
|
||||||
min_length: 1
|
min_length: 1
|
||||||
regexp: ""
|
regexp: ""
|
||||||
is_for_all: true
|
is_for_all: true
|
||||||
type: IssueCustomField
|
type: IssueCustomField
|
||||||
max_length: 10
|
max_length: 100
|
||||||
possible_values: ""
|
possible_values: ""
|
||||||
id: 2
|
id: 2
|
||||||
is_required: false
|
is_required: false
|
||||||
field_format: string
|
field_format: string
|
||||||
|
searchable: true
|
||||||
custom_fields_003:
|
custom_fields_003:
|
||||||
name: Development status
|
name: Development status
|
||||||
min_length: 0
|
min_length: 0
|
||||||
|
|||||||
Vendored
+7
@@ -47,3 +47,10 @@ custom_values_008:
|
|||||||
customized_id: 3
|
customized_id: 3
|
||||||
id: 11
|
id: 11
|
||||||
value: "MySQL"
|
value: "MySQL"
|
||||||
|
custom_values_009:
|
||||||
|
customized_type: Issue
|
||||||
|
custom_field_id: 2
|
||||||
|
customized_id: 3
|
||||||
|
id: 12
|
||||||
|
value: "this is a stringforcustomfield search"
|
||||||
|
|
||||||
Vendored
+9
@@ -31,3 +31,12 @@ enabled_modules_008:
|
|||||||
name: boards
|
name: boards
|
||||||
project_id: 1
|
project_id: 1
|
||||||
id: 8
|
id: 8
|
||||||
|
enabled_modules_009:
|
||||||
|
name: repository
|
||||||
|
project_id: 3
|
||||||
|
id: 9
|
||||||
|
enabled_modules_010:
|
||||||
|
name: wiki
|
||||||
|
project_id: 3
|
||||||
|
id: 10
|
||||||
|
|
||||||
Vendored
+2
@@ -41,6 +41,8 @@ issues_003:
|
|||||||
assigned_to_id:
|
assigned_to_id:
|
||||||
author_id: 2
|
author_id: 2
|
||||||
status_id: 1
|
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:
|
issues_004:
|
||||||
created_on: 2006-07-19 21:07:27 +02:00
|
created_on: 2006-07-19 21:07:27 +02:00
|
||||||
project_id: 2
|
project_id: 2
|
||||||
|
|||||||
Vendored
+4
-2
@@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
repositories_001:
|
repositories_001:
|
||||||
project_id: 1
|
project_id: 1
|
||||||
url: svn://localhost/test
|
url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
|
||||||
id: 10
|
id: 10
|
||||||
root_url: svn://localhost
|
root_url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
|
||||||
password: ""
|
password: ""
|
||||||
login: ""
|
login: ""
|
||||||
|
type: Subversion
|
||||||
repositories_002:
|
repositories_002:
|
||||||
project_id: 2
|
project_id: 2
|
||||||
url: svn://localhost/test
|
url: svn://localhost/test
|
||||||
@@ -13,3 +14,4 @@ repositories_002:
|
|||||||
root_url: svn://localhost
|
root_url: svn://localhost
|
||||||
password: ""
|
password: ""
|
||||||
login: ""
|
login: ""
|
||||||
|
type: Subversion
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Vendored
+3
-1
@@ -39,7 +39,6 @@ roles_005:
|
|||||||
- :view_time_entries
|
- :view_time_entries
|
||||||
- :view_documents
|
- :view_documents
|
||||||
- :view_wiki_pages
|
- :view_wiki_pages
|
||||||
- :edit_wiki_pages
|
|
||||||
- :view_files
|
- :view_files
|
||||||
- :browse_repository
|
- :browse_repository
|
||||||
- :view_changesets
|
- :view_changesets
|
||||||
@@ -75,7 +74,10 @@ roles_001:
|
|||||||
- :view_wiki_pages
|
- :view_wiki_pages
|
||||||
- :edit_wiki_pages
|
- :edit_wiki_pages
|
||||||
- :delete_wiki_pages
|
- :delete_wiki_pages
|
||||||
|
- :rename_wiki_pages
|
||||||
- :add_messages
|
- :add_messages
|
||||||
|
- :edit_messages
|
||||||
|
- :delete_messages
|
||||||
- :manage_boards
|
- :manage_boards
|
||||||
- :view_files
|
- :view_files
|
||||||
- :manage_files
|
- :manage_files
|
||||||
|
|||||||
+12
@@ -37,4 +37,16 @@ wiki_content_versions_003:
|
|||||||
data: |-
|
data: |-
|
||||||
h1. CookBook documentation
|
h1. CookBook documentation
|
||||||
Some updated [[documentation]] here...
|
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
|
||||||
|
version: 1
|
||||||
|
author_id: 1
|
||||||
|
comments:
|
||||||
|
|
||||||
|
|||||||
Vendored
+12
@@ -10,3 +10,15 @@ wiki_contents_001:
|
|||||||
version: 3
|
version: 3
|
||||||
author_id: 1
|
author_id: 1
|
||||||
comments: Gzip compression activated
|
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
|
||||||
|
comments:
|
||||||
|
|
||||||
Vendored
+6
@@ -4,3 +4,9 @@ wiki_pages_001:
|
|||||||
title: CookBook_documentation
|
title: CookBook_documentation
|
||||||
id: 1
|
id: 1
|
||||||
wiki_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
|
||||||
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# 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
|
||||||
@@ -22,7 +22,17 @@ require 'issues_controller'
|
|||||||
class IssuesController; def rescue_action(e) raise e end; end
|
class IssuesController; def rescue_action(e) raise e end; end
|
||||||
|
|
||||||
class IssuesControllerTest < Test::Unit::TestCase
|
class IssuesControllerTest < Test::Unit::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :issues, :enabled_modules, :enumerations
|
fixtures :projects,
|
||||||
|
:users,
|
||||||
|
:roles,
|
||||||
|
:members,
|
||||||
|
:issues,
|
||||||
|
:issue_statuses,
|
||||||
|
:trackers,
|
||||||
|
:issue_categories,
|
||||||
|
:enabled_modules,
|
||||||
|
:enumerations,
|
||||||
|
:attachments
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssuesController.new
|
@controller = IssuesController.new
|
||||||
@@ -83,4 +93,71 @@ class IssuesControllerTest < Test::Unit::TestCase
|
|||||||
assert_not_nil assigns(:changes)
|
assert_not_nil assigns(:changes)
|
||||||
assert_equal 'application/atom+xml', @response.content_type
|
assert_equal 'application/atom+xml', @response.content_type
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -40,10 +40,60 @@ class MessagesControllerTest < Test::Unit::TestCase
|
|||||||
assert_not_nil assigns(:topic)
|
assert_not_nil assigns(:topic)
|
||||||
end
|
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
|
def test_reply
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
|
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
|
||||||
assert_redirected_to 'messages/show'
|
assert_redirected_to 'messages/show'
|
||||||
assert Message.find_by_subject('Test reply')
|
assert Message.find_by_subject('Test reply')
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require 'my_controller'
|
|||||||
class MyController; def rescue_action(e) raise e end; end
|
class MyController; def rescue_action(e) raise e end; end
|
||||||
|
|
||||||
class MyControllerTest < Test::Unit::TestCase
|
class MyControllerTest < Test::Unit::TestCase
|
||||||
fixtures :users
|
fixtures :users, :issues, :issue_statuses, :trackers, :enumerations
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = MyController.new
|
@controller = MyController.new
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ require 'projects_controller'
|
|||||||
class ProjectsController; def rescue_action(e) raise e end; end
|
class ProjectsController; def rescue_action(e) raise e end; end
|
||||||
|
|
||||||
class ProjectsControllerTest < Test::Unit::TestCase
|
class ProjectsControllerTest < Test::Unit::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
|
fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = ProjectsController.new
|
@controller = ProjectsController.new
|
||||||
@@ -41,6 +41,10 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'list'
|
assert_template 'list'
|
||||||
assert_not_nil assigns(:project_tree)
|
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
|
end
|
||||||
|
|
||||||
def test_show
|
def test_show
|
||||||
@@ -50,6 +54,36 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
|||||||
assert_not_nil assigns(:project)
|
assert_not_nil assigns(:project)
|
||||||
end
|
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
|
def test_list_documents
|
||||||
get :list_documents, :id => 1
|
get :list_documents, :id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@@ -67,6 +101,22 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
|||||||
assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes
|
assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes
|
||||||
end
|
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
|
def test_list_files
|
||||||
get :list_files, :id => 1
|
get :list_files, :id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@@ -86,6 +136,21 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'roadmap'
|
assert_template 'roadmap'
|
||||||
assert_not_nil assigns(:versions)
|
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
|
end
|
||||||
|
|
||||||
def test_activity
|
def test_activity
|
||||||
@@ -120,6 +185,42 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
|||||||
}
|
}
|
||||||
end
|
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
|
def test_archive
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
post :archive, :id => 1
|
post :archive, :id => 1
|
||||||
|
|||||||
@@ -31,6 +31,13 @@ class RepositoriesControllerTest < Test::Unit::TestCase
|
|||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
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
|
def test_revision_with_before_nil_and_afer_normal
|
||||||
get :revision, {:id => 1, :rev => 1}
|
get :revision, {:id => 1, :rev => 1}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@@ -43,4 +50,15 @@ class RepositoriesControllerTest < Test::Unit::TestCase
|
|||||||
}
|
}
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
# 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
|
||||||
@@ -5,7 +5,7 @@ require 'search_controller'
|
|||||||
class SearchController; def rescue_action(e) raise e end; end
|
class SearchController; def rescue_action(e) raise e end; end
|
||||||
|
|
||||||
class SearchControllerTest < Test::Unit::TestCase
|
class SearchControllerTest < Test::Unit::TestCase
|
||||||
fixtures :projects, :issues
|
fixtures :projects, :issues, :custom_fields, :custom_values
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = SearchController.new
|
@controller = SearchController.new
|
||||||
@@ -25,7 +25,9 @@ class SearchControllerTest < Test::Unit::TestCase
|
|||||||
assert assigns(:results).include?(Project.find(1))
|
assert assigns(:results).include?(Project.find(1))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_search_in_project
|
def test_search_without_searchable_custom_fields
|
||||||
|
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"
|
||||||
|
|
||||||
get :index, :id => 1
|
get :index, :id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'index'
|
assert_template 'index'
|
||||||
@@ -36,6 +38,15 @@ class SearchControllerTest < Test::Unit::TestCase
|
|||||||
assert_template 'index'
|
assert_template 'index'
|
||||||
end
|
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
|
def test_quick_jump_to_issue
|
||||||
# issue of a public project
|
# issue of a public project
|
||||||
get :index, :q => "3"
|
get :index, :q => "3"
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# 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
|
||||||
@@ -39,4 +39,35 @@ class VersionsControllerTest < Test::Unit::TestCase
|
|||||||
|
|
||||||
assert_tag :tag => 'h2', :content => /1.0/
|
assert_tag :tag => 'h2', :content => /1.0/
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# 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
|
||||||
@@ -21,7 +21,8 @@ class RepositoryBazaarTest < Test::Unit::TestCase
|
|||||||
fixtures :projects
|
fixtures :projects
|
||||||
|
|
||||||
# No '..' in the repository path
|
# No '..' in the repository path
|
||||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + 'tmp/test/bazaar_repository'
|
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/bazaar_repository'
|
||||||
|
REPOSITORY_PATH.gsub!(/\/+/, '/')
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@project = Project.find(1)
|
@project = Project.find(1)
|
||||||
@@ -81,7 +82,7 @@ class RepositoryBazaarTest < Test::Unit::TestCase
|
|||||||
assert_equal 'mkdir', annotate.lines[0]
|
assert_equal 'mkdir', annotate.lines[0]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "Bazaar test repository NOT FOUND. Skipping tests !!!"
|
puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!"
|
||||||
def test_fake; assert true end
|
def test_fake; assert true end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
# 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
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# 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
|
||||||
@@ -49,7 +49,7 @@ class RepositorySubversionTest < Test::Unit::TestCase
|
|||||||
assert_equal 8, @repository.changesets.count
|
assert_equal 8, @repository.changesets.count
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "Subversion test repository NOT FOUND. Skipping tests !!!"
|
puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"
|
||||||
def test_fake; assert true end
|
def test_fake; assert true end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+21
-2
@@ -49,6 +49,9 @@ module Redmine
|
|||||||
raise 'No date column defined defined.'
|
raise 'No date column defined defined.'
|
||||||
end
|
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
|
send :include, Redmine::Acts::Searchable::InstanceMethods
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -67,11 +70,27 @@ module Redmine
|
|||||||
columns = searchable_options[:columns]
|
columns = searchable_options[:columns]
|
||||||
columns.slice!(1..-1) if options[:titles_only]
|
columns.slice!(1..-1) if options[:titles_only]
|
||||||
|
|
||||||
sql = ([ '(' + columns.collect {|column| "(LOWER(#{column}) LIKE ?)"}.join(' OR ') + ')' ] * tokens.size).join(options[:all_words] ? ' AND ' : ' OR ')
|
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 ')
|
||||||
|
|
||||||
if options[:offset]
|
if options[:offset]
|
||||||
sql = "(#{sql}) AND (#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')"
|
sql = "(#{sql}) AND (#{searchable_options[:date_column]} " + (options[:before] ? '<' : '>') + "'#{connection.quoted_date(options[:offset])}')"
|
||||||
end
|
end
|
||||||
find_options[:conditions] = [sql, * (tokens * columns.size).sort]
|
find_options[:conditions] = [sql, * (tokens * token_clauses.size).sort]
|
||||||
|
|
||||||
results = with_scope(:find => {:conditions => ["#{searchable_options[:project_key]} = ?", project.id]}) do
|
results = with_scope(:find => {:conditions => ["#{searchable_options[:project_key]} = ?", project.id]}) do
|
||||||
find(:all, find_options)
|
find(:all, find_options)
|
||||||
|
|||||||
Reference in New Issue
Block a user