* Updated gemfile

* Added forum post/topic unit tests
* Added forum post/topic controller tests
This commit is contained in:
albert
2011-01-12 18:00:07 -05:00
parent 46164eab4f
commit 668fbab77a
18 changed files with 342 additions and 105 deletions

View File

@@ -0,0 +1,7 @@
<div>
<%= simple_form_for @search do |f| %>
<%= f.input :title_matches %>
<%= f.input :creator_name_equals %>
<%= f.button :submit %>
<% end %>
</div>

View File

@@ -0,0 +1,12 @@
<h1>Edit Topic</h1>
<%= simple_form_for(@forum_topic) do |f| %>
<%= f.input :title %>
<%= f.simple_fields_for :original_post do |pf| %>
<%= text_field_tag "forum_topic[original_post_attributes][topic_id]", @forum_topic.id %>
<%= pf.input :body %>
<% end %>
<%= f.button :submit %>
<% end %>

View File

@@ -0,0 +1,24 @@
<h1>Forum</h1>
<%= render "search" %>
<table>
<thead>
<tr>
<th>Creator</th>
<th>Title</th>
<th>Updated by</th>
<th>Updated at</th>
</tr>
</thead>
<tbody>
<% @forum_topics.each do |topic| %>
<tr>
<td><%= topic.creator.name %></td>
<td><%= topic.title %></td>
<td><%= topic.updater.name %></td>
<td><%= compact_time topic.updated_at %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,11 @@
<h1>New Topic</h1>
<%= simple_form_for(@forum_topic) do |f| %>
<%= f.input :title %>
<%= f.simple_fields_for :original_post do |pf| %>
<%= pf.input :body %>
<% end %>
<%= f.button :submit %>
<% end %>