diff options
author | jessib <jessib@riseup.net> | 2012-10-02 15:29:28 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2012-10-02 15:29:28 -0700 |
commit | 5bc3eae400754dda90a45d6953a02a069a1c0285 (patch) | |
tree | 9391b3bb5c3f0847746b52805c61ea346486301a /help/test/unit | |
parent | 61d73ac517ccbcc7ca8892010ef89e861052807f (diff) |
Some more tweaks to help ticket models. Still want to tweak current_user access from users engine.
Diffstat (limited to 'help/test/unit')
-rw-r--r-- | help/test/unit/ticket_comment_test.rb | 7 | ||||
-rw-r--r-- | help/test/unit/ticket_test.rb | 3 |
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 |