summaryrefslogtreecommitdiff
path: root/help/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'help/test/unit')
-rw-r--r--help/test/unit/ticket_comment_test.rb7
-rw-r--r--help/test/unit/ticket_test.rb3
2 files changed, 9 insertions, 1 deletions
diff --git a/help/test/unit/ticket_comment_test.rb b/help/test/unit/ticket_comment_test.rb
index 37e6e67..ba6120b 100644
--- a/help/test/unit/ticket_comment_test.rb
+++ b/help/test/unit/ticket_comment_test.rb
@@ -25,6 +25,13 @@ class TicketCommentTest < ActiveSupport::TestCase
#tc.ticket = Ticket.find_by_title("test title")
#tc.ticket.title
end
+
+ test "create authenticated comment" do
+ User.current = 4
+ comment2 = TicketComment.new :body => "help my email is broken!"
+ comment2.save
+ assert_not_nil comment2.posted_by
+ end
test "add comments" do
testticket = Ticket.create :title => "testing"
diff --git a/help/test/unit/ticket_test.rb b/help/test/unit/ticket_test.rb
index fddd719..2dbd63c 100644
--- a/help/test/unit/ticket_test.rb
+++ b/help/test/unit/ticket_test.rb
@@ -41,7 +41,8 @@ class TicketTest < ActiveSupport::TestCase
assert_not_nil t1.code
assert_nil t1.created_by
- t2 = Ticket.create :title => 'test title', :created_by => 4
+ User.current = 4
+ t2 = Ticket.create :title => 'test title'
assert_nil t2.code
assert_not_nil t2.created_by