Fixed: 10342 Creation of Schema in Oracle

Comment is a reserved keyword for Oracle. The five 'Comment' columns are renamed to 'Commments'.
Migration scripts were modified to let oracle users create the database. For the others, migration 41 will rename the columns (only if columns have the 'old' name).
Fixed also a few oracle specific issues.

Note: currently (in Rails 1.2.3), there's bug in Rails oracle adapter. See: http://dev.rubyonrails.org/ticket/7344
Attached patch is required for redMine to work properly.


git-svn-id: http://redmine.rubyforge.org/svn/trunk@479 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-04-25 15:06:20 +00:00
parent 4967fa8733
commit 52547466f0
41 changed files with 80 additions and 60 deletions

View File

@ -503,7 +503,7 @@ class ProjectsController < ApplicationController
end
unless params[:show_wiki_edits] == "0"
select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comment, " +
select = "#{WikiContent.versioned_table_name}.updated_on, #{WikiContent.versioned_table_name}.comments, " +
"#{WikiContent.versioned_table_name}.#{WikiContent.version_column}, #{WikiPage.table_name}.title"
joins = "LEFT JOIN #{WikiPage.table_name} ON #{WikiPage.table_name}.id = #{WikiContent.versioned_table_name}.page_id " +
"LEFT JOIN #{Wiki.table_name} ON #{Wiki.table_name}.id = #{WikiPage.table_name}.wiki_id "
@ -624,7 +624,7 @@ class ProjectsController < ApplicationController
# no more than 5 tokens to search for
@tokens.slice! 5..-1 if @tokens.size > 5
# strings used in sql like statement
like_tokens = @tokens.collect {|w| "%#{w}%"}
like_tokens = @tokens.collect {|w| "%#{w.downcase}%"}
operator = @all_words ? " AND " : " OR "
limit = 10
@results = []
@ -632,7 +632,7 @@ class ProjectsController < ApplicationController
@results += @project.news.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort], :include => :author ) if @scope.include? 'news'
@results += @project.documents.find(:all, :limit => limit, :conditions => [ (["(LOWER(title) like ? OR LOWER(description) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @scope.include? 'documents'
@results += @project.wiki.pages.find(:all, :limit => limit, :include => :content, :conditions => [ (["(LOWER(title) like ? OR LOWER(text) like ?)"] * like_tokens.size).join(operator), * (like_tokens * 2).sort] ) if @project.wiki && @scope.include?('wiki')
@results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comment) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets')
@results += @project.repository.changesets.find(:all, :limit => limit, :conditions => [ (["(LOWER(comments) like ?)"] * like_tokens.size).join(operator), * (like_tokens).sort] ) if @project.repository && @scope.include?('changesets')
@question = @tokens.join(" ")
else
@question = ""

View File

@ -59,7 +59,7 @@ private
l(:field_activity),
l(:field_issue),
l(:field_hours),
l(:field_comment)
l(:field_comments)
]
csv << headers.collect {|c| ic.iconv(c) }
# csv lines
@ -69,7 +69,7 @@ private
entry.activity.name,
(entry.issue ? entry.issue.id : nil),
entry.hours,
entry.comment
entry.comments
]
csv << fields.collect {|c| ic.iconv(c.to_s) }
end

View File

@ -47,7 +47,7 @@ class WikiController < ApplicationController
@content = @page.content_for_version(params[:version])
@content.text = "h1. #{@page.pretty_title}" if @content.text.blank?
# don't keep previous comment
@content.comment = nil
@content.comments = nil
if request.post?
if @content.text == params[:content][:text]
# don't save if text wasn't changed
@ -55,7 +55,7 @@ class WikiController < ApplicationController
return
end
@content.text = params[:content][:text]
@content.comment = params[:content][:comment]
@content.comments = params[:content][:comments]
@content.author = logged_in_user
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
@ -69,7 +69,7 @@ class WikiController < ApplicationController
@page = @wiki.find_page(params[:page])
# don't load text
@versions = @page.content.versions.find :all,
:select => "id, author_id, comment, updated_on, version",
:select => "id, author_id, comments, updated_on, version",
:order => 'version DESC'
end

View File

@ -113,6 +113,8 @@ module ApplicationHelper
# textilize text according to system settings and RedCloth availability
def textilizable(text, options = {})
return "" if text.blank?
# different methods for formatting wiki links
case options[:wiki_links]
when :local

View File

@ -34,7 +34,7 @@ class Changeset < ActiveRecord::Base
end
def scan_comment_for_issue_ids
return if comment.blank?
return if comments.blank?
# keywords used to reference issues
ref_keywords = Setting.commit_ref_keywords.downcase.split(",")
# keywords used to fix issues
@ -48,7 +48,7 @@ class Changeset < ActiveRecord::Base
# remove any associated issues
self.issues.clear
comment.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match|
comments.scan(Regexp.new("(#{kw_regexp})[\s:]+(([\s,;&]*#?\\d+)+)", Regexp::IGNORECASE)).each do |match|
action = match[0]
target_issue_ids = match[1].scan(/\d+/)
target_issues = repository.project.issues.find_all_by_id(target_issue_ids)

View File

@ -19,5 +19,5 @@ class Comment < ActiveRecord::Base
belongs_to :commented, :polymorphic => true, :counter_cache => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
validates_presence_of :commented, :author, :comment
validates_presence_of :commented, :author, :comments
end

View File

@ -22,7 +22,7 @@ class CustomValue < ActiveRecord::Base
protected
def validate
errors.add(:value, :activerecord_error_blank) and return if custom_field.is_required? and value.empty?
errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.empty? or value =~ Regexp.new(custom_field.regexp)
errors.add(:value, :activerecord_error_invalid) unless custom_field.regexp.blank? or value =~ Regexp.new(custom_field.regexp)
errors.add(:value, :activerecord_error_too_short) if custom_field.min_length > 0 and value.length < custom_field.min_length and value.length > 0
errors.add(:value, :activerecord_error_too_long) if custom_field.max_length > 0 and value.length > custom_field.max_length
case custom_field.field_format

View File

@ -62,7 +62,7 @@ class Repository < ActiveRecord::Base
:revision => revision.identifier,
:committer => revision.author,
:committed_on => revision.time,
:comment => revision.message)
:comments => revision.message)
revision.paths.each do |change|
Change.create(:changeset => changeset,

View File

@ -10,7 +10,7 @@ class TimeEntry < ActiveRecord::Base
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
validates_numericality_of :hours, :allow_nil => true
validates_length_of :comment, :maximum => 255
validates_length_of :comments, :maximum => 255
def before_validation
self.project = issue.project if issue && project.nil?
@ -28,6 +28,6 @@ class TimeEntry < ActiveRecord::Base
super
self.tyear = spent_on ? spent_on.year : nil
self.tmonth = spent_on ? spent_on.month : nil
self.tweek = spent_on ? spent_on.cweek : nil
self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil
end
end

View File

@ -26,11 +26,15 @@ class UserPreference < ActiveRecord::Base
self.others ||= {}
end
def before_save
self.others ||= {}
end
def [](attr_name)
if attribute_present? attr_name
super
else
others[attr_name]
others ? others[attr_name] : nil
end
end
@ -38,7 +42,8 @@ class UserPreference < ActiveRecord::Base
if attribute_present? attr_name
super
else
others.store attr_name, value
self.others ||= {}
self.others.store attr_name, value
end
end
end

View File

@ -19,14 +19,14 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</div>
<%= simple_format(auto_link(h comment.comment))%>
<%= simple_format(auto_link(h comment.comments))%>
<% end if @news.comments_count > 0 %>
</div>
<% if authorize_for 'news', 'add_comment' %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comment" %></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 %>
<%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %>
<%= text_area 'comment', 'comments', :cols => 60, :rows => 6 %>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
<% end %>

View File

@ -39,10 +39,10 @@
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br />
<% elsif e.is_a? WikiContent.versioned_class %>
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_wiki_edit)%>: <%= link_to h(WikiPage.pretty_title(e.title)), :controller => 'wiki', :page => e.title %> (<%= link_to '#' + e.version.to_s, :controller => 'wiki', :page => e.title, :version => e.version %>)<br />
<% unless e.comment.blank? %><em><%=h e.comment %></em><% end %>
<% unless e.comments.blank? %><em><%=h e.comments %></em><% end %>
<% elsif e.is_a? Changeset %>
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
<em><%=h e.committer.blank? ? "anonymous" : e.committer %><%= h(": #{truncate(e.comment, 500)}") unless e.comment.blank? %></em>
<em><%=h e.committer.blank? ? "anonymous" : e.committer %><%= h(": #{truncate(e.comments, 500)}") unless e.comments.blank? %></em>
<% end %>
</p></li>

View File

@ -41,7 +41,7 @@
<i><%= e.content.author ? e.content.author.name : "Anonymous" %>, <%= format_time(e.content.updated_on) %></i>
<% elsif e.is_a? Changeset %>
<%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
<%= highlight_tokens(e.comment, @tokens) %><br />
<%= highlight_tokens(e.comments, @tokens) %><br />
<em><%= e.committer.blank? ? e.committer : "Anonymous" %>, <%= format_time(e.committed_on) %></em>
<% end %>
</p></li>

View File

@ -7,7 +7,7 @@
<div class="splitcontentleft">
<%= textilizable @project.description %>
<ul>
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
<% unless @project.parent.nil? %>
<li><%=l(:field_parent)%>: <%= link_to @project.parent.name, :controller => 'projects', :action => 'show', :id => @project.parent %></li>

View File

@ -3,7 +3,7 @@
<th>#</th>
<th><%= l(:label_date) %></th>
<th><%= l(:field_author) %></th>
<th><%= l(:field_comment) %></th>
<th><%= l(:field_comments) %></th>
<th></th>
</tr></thead>
<tbody>
@ -12,7 +12,7 @@
<th align="center" style="width:5%"><%= link_to changeset.revision, :action => 'revision', :id => project, :rev => changeset.revision %></th>
<td align="center" style="width:15%"><%= format_time(changeset.committed_on) %></td>
<td align="center" style="width:15%"><em><%=h changeset.committer %></em></td>
<td align="left"><%= textilizable(changeset.comment) %></td>
<td align="left"><%= textilizable(changeset.comments) %></td>
<td align="center"><%= link_to l(:label_view_diff), :action => 'diff', :id => project, :path => path, :rev => changeset.revision if entry && entry.is_file? && changeset != changesets.last %></td>
</tr>
<% end %>

View File

@ -8,7 +8,7 @@
<h2><%= l(:label_revision) %> <%= @changeset.revision %></h2>
<p><em><%= @changeset.committer %>, <%= format_time(@changeset.committed_on) %></em></p>
<%= textilizable @changeset.comment %>
<%= textilizable @changeset.comments %>
<% if @changeset.issues.any? %>
<h3><%= l(:label_related_issues) %></h3>

View File

@ -16,7 +16,7 @@
<%= sort_header_tag('user_id', :caption => l(:label_member)) %>
<%= sort_header_tag('activity_id', :caption => l(:label_activity)) %>
<%= sort_header_tag('issue_id', :caption => l(:label_issue)) %>
<th><%= l(:label_comment) %></th>
<th><%= l(:label_comments) %></th>
<%= sort_header_tag('hours', :caption => l(:field_hours)) %>
<th></th>
</thead>
@ -36,7 +36,7 @@
</div>
<% end %>
</td>
<td><%=h entry.comment %></td>
<td><%=h entry.comments %></td>
<td align="center"><strong><%= entry.hours %></strong></td>
<td align="center"><%= link_to_if_authorized(l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => entry}, :class => "icon icon-edit") if entry.user_id == @owner_id %></td>
</tr>

View File

@ -7,7 +7,7 @@
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
<p><%= f.text_field :comment, :size => 100 %></p>
<p><%= f.text_field :comments, :size => 100 %></p>
<p><%= f.select :activity_id, (@activities.collect {|p| [p.name, p.id]}), :required => true %></p>
</div>

View File

@ -12,7 +12,7 @@
:onclick => "window.open('#{ url_for :controller => 'help', :ctrl => 'wiki', :page => 'syntax' }', '', 'resizable=yes, location=no, width=300, height=500, menubar=no, status=no, scrollbars=yes'); return false;" %>
</div>
<p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit' %></p>
<p><label><%= l(:field_comment) %></label><br /><%= f.text_field :comment, :size => 120 %></p>
<p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p>
<p><%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview),
{ :url => { :controller => 'wiki', :action => 'preview', :id => @project, :page => @page.title },

View File

@ -11,7 +11,7 @@
<th>#</th>
<th><%= l(:field_updated_on) %></th>
<th><%= l(:field_author) %></th>
<th><%= l(:field_comment) %></th>
<th><%= l(:field_comments) %></th>
</tr></thead>
<tbody>
<% @versions.each do |ver| %>
@ -19,7 +19,7 @@
<th align="center"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></th>
<td align="center"><%= format_time(ver.updated_on) %></td>
<td><em><%= ver.author ? ver.author.name : "anonyme" %></em></td>
<td><%=h ver.comment %></td>
<td><%=h ver.comments %></td>
</tr>
<% end %>
</tbody>

View File

@ -13,7 +13,7 @@
<%= link_to(l(:label_current_version), :action => 'index', :page => @page.title) %>
<br />
<em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br />
<%=h @content.comment %>
<%=h @content.comments %>
</p>
<hr />
<% end %>

View File

@ -4,7 +4,7 @@
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

View File

@ -4,7 +4,7 @@ class CreateComments < ActiveRecord::Migration
t.column :commented_type, :string, :limit => 30, :default => "", :null => false
t.column :commented_id, :integer, :default => 0, :null => false
t.column :author_id, :integer, :default => 0, :null => false
t.column :comment, :text
t.column :comments, :text
t.column :created_on, :datetime, :null => false
t.column :updated_on, :datetime, :null => false
end

View File

@ -4,7 +4,7 @@ class CreateWikiContents < ActiveRecord::Migration
t.column :page_id, :integer, :null => false
t.column :author_id, :integer
t.column :text, :text
t.column :comment, :string, :limit => 255, :default => ""
t.column :comments, :string, :limit => 255, :default => ""
t.column :updated_on, :datetime, :null => false
t.column :version, :integer, :null => false
end
@ -16,7 +16,7 @@ class CreateWikiContents < ActiveRecord::Migration
t.column :author_id, :integer
t.column :data, :binary
t.column :compression, :string, :limit => 6, :default => ""
t.column :comment, :string, :limit => 255, :default => ""
t.column :comments, :string, :limit => 255, :default => ""
t.column :updated_on, :datetime, :null => false
t.column :version, :integer, :null => false
end

View File

@ -5,7 +5,7 @@ class CreateTimeEntries < ActiveRecord::Migration
t.column :user_id, :integer, :null => false
t.column :issue_id, :integer
t.column :hours, :float, :null => false
t.column :comment, :string, :limit => 255
t.column :comments, :string, :limit => 255
t.column :activity_id, :integer, :null => false
t.column :spent_on, :date, :null => false
t.column :tyear, :integer, :null => false

View File

@ -5,7 +5,7 @@ class CreateChangesets < ActiveRecord::Migration
t.column :revision, :integer, :null => false
t.column :committer, :string, :limit => 30
t.column :committed_on, :datetime, :null => false
t.column :comment, :text
t.column :comments, :text
end
add_index :changesets, [:repository_id, :revision], :unique => true, :name => :changesets_repos_rev
end

View File

@ -0,0 +1,13 @@
class RenameCommentToComments < ActiveRecord::Migration
def self.up
rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns("comments").detect{|c| c.name == "comment"}
rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_contents").detect{|c| c.name == "comment"}
rename_column(:wiki_content_versions, :comment, :comments) if ActiveRecord::Base.connection.columns("wiki_content_versions").detect{|c| c.name == "comment"}
rename_column(:time_entries, :comment, :comments) if ActiveRecord::Base.connection.columns("time_entries").detect{|c| c.name == "comment"}
rename_column(:changesets, :comment, :comments) if ActiveRecord::Base.connection.columns("changesets").detect{|c| c.name == "comment"}
end
def self.down
raise IrreversibleMigration
end
end

View File

@ -139,7 +139,7 @@ field_start_date: Beginn
field_done_ratio: %% erledigt
field_auth_source: Authentifizierungs-Modus
field_hide_mail: Email Adresse nicht anzeigen
field_comment: Kommentar
field_comments: Kommentar
field_url: URL
field_start_page: Hauptseite
field_subproject: Subprojekt von

View File

@ -139,7 +139,7 @@ field_start_date: Start
field_done_ratio: %% Done
field_auth_source: Authentication mode
field_hide_mail: Hide my email address
field_comment: Comment
field_comments: Comment
field_url: URL
field_start_page: Start page
field_subproject: Subproject

View File

@ -139,7 +139,7 @@ field_start_date: Comienzo
field_done_ratio: %% Realizado
field_auth_source: Modo de la autentificación
field_hide_mail: Ocultar mi email address
field_comment: Comentario
field_comments: Comentario
field_url: URL
field_start_page: Página principal
field_subproject: Proyecto secundario

View File

@ -139,7 +139,7 @@ field_start_date: Début
field_done_ratio: %% Réalisé
field_auth_source: Mode d'authentification
field_hide_mail: Cacher mon adresse mail
field_comment: Commentaire
field_comments: Commentaire
field_url: URL
field_start_page: Page de démarrage
field_subproject: Sous-projet

View File

@ -139,7 +139,7 @@ field_start_date: Inizio
field_done_ratio: %% completo
field_auth_source: Modalità di autenticazione
field_hide_mail: Nascondi il mio indirizzo di e-mail
field_comment: Commento
field_comments: Commento
field_url: URL
field_start_page: Pagina principale
field_subproject: Sottoprogetto

View File

@ -140,7 +140,7 @@ field_start_date: 開始日
field_done_ratio: 進捗 %%
field_auth_source: 認証モード
field_hide_mail: メールアドレスを隠す
field_comment: コメント
field_comments: コメント
field_url: URL
field_start_page: メインページ
field_subproject: サブプロジェクト

View File

@ -139,7 +139,7 @@ field_start_date: Inicio
field_done_ratio: %% Terminado
field_auth_source: Modo de autenticacao
field_hide_mail: Esconder meu email
field_comment: Comentario
field_comments: Comentario
field_url: URL
field_start_page: Pagina inicial
field_subproject: Sub-projeto

View File

@ -142,7 +142,7 @@ field_start_date: 开始
field_done_ratio: %% 完成
field_auth_source: 认证模式
field_hide_mail: 隐藏我的邮件
field_comment: 注释
field_comments: 注释
field_url: URL
field_start_page: 起始页
field_subproject: 子项目

View File

@ -4,7 +4,7 @@ changesets_001:
committed_on: 2007-04-11 15:14:44 +02:00
revision: 1
id: 100
comment: My very first commit
comments: My very first commit
repository_id: 10
committer: dlopper
changesets_002:
@ -12,7 +12,7 @@ changesets_002:
committed_on: 2007-04-12 15:14:44 +02:00
revision: 2
id: 101
comment: 'This commit fixes #1, #2 and references #3'
comments: 'This commit fixes #1, #2 and references #3'
repository_id: 10
committer: dlopper
changesets_003:
@ -20,7 +20,7 @@ changesets_003:
committed_on: 2007-04-12 15:14:44 +02:00
revision: 3
id: 102
comment: |-
comments: |-
A commit with wrong issue ids
IssueID 666 3
repository_id: 10
@ -30,7 +30,7 @@ changesets_004:
committed_on: 2007-04-12 15:14:44 +02:00
revision: 4
id: 103
comment: |-
comments: |-
A commit with an issue id of an other project
IssueID 4 2
repository_id: 10

View File

@ -4,7 +4,7 @@ comments_001:
commented_id: 1
id: 1
author_id: 1
comment: my first comment
comments: my first comment
created_on: 2006-12-10 18:10:10 +01:00
updated_on: 2006-12-10 18:10:10 +01:00

View File

@ -5,7 +5,7 @@ wiki_content_versions_001:
id: 1
version: 1
author_id: 1
comment: Page creation
comments: Page creation
wiki_content_id: 1
compression: ""
data: |-
@ -18,7 +18,7 @@ wiki_content_versions_002:
id: 2
version: 2
author_id: 1
comment: Small update
comments: Small update
wiki_content_id: 1
compression: ""
data: |-
@ -31,7 +31,7 @@ wiki_content_versions_003:
id: 3
version: 3
author_id: 1
comment: ""
comments: ""
wiki_content_id: 1
compression: ""
data: |-

View File

@ -9,4 +9,4 @@ wiki_contents_001:
id: 1
version: 3
author_id: 1
comment: Gzip compression activated
comments: Gzip compression activated

View File

@ -26,7 +26,7 @@ class CommentTest < Test::Unit::TestCase
end
def test_create
comment = Comment.new(:commented => @news, :author => @jsmith, :comment => "my comment")
comment = Comment.new(:commented => @news, :author => @jsmith, :comments => "my comment")
assert comment.save
@news.reload
assert_equal 2, @news.comments_count

View File

@ -27,7 +27,7 @@ class WikiContentTest < Test::Unit::TestCase
def test_create
page = WikiPage.new(:wiki => @wiki, :title => "Page")
page.content = WikiContent.new(:text => "Content text", :author => User.find(1), :comment => "My comment")
page.content = WikiContent.new(:text => "Content text", :author => User.find(1), :comments => "My comment")
assert page.save
page.reload
@ -36,7 +36,7 @@ class WikiContentTest < Test::Unit::TestCase
assert_equal 1, content.version
assert_equal 1, content.versions.length
assert_equal "Content text", content.text
assert_equal "My comment", content.comment
assert_equal "My comment", content.comments
assert_equal User.find(1), content.author
assert_equal content.text, content.versions.last.text
end