Commit fb7f109a authored by Gregor Schmidt's avatar Gregor Schmidt

[#708] Adding tests exposing the erroneous behavior

parent e2938d26
......@@ -115,4 +115,29 @@ class JournalTest < ActiveSupport::TestCase
assert_equal "Test setting fields on Journal from Issue", @issue.last_journal.notes
assert_equal @issue.author, @issue.last_journal.user
end
test "subclasses of journaled models should have journal of parent type" do
Ticket = Class.new(Issue)
project = Project.generate!
ticket = Ticket.new do |t|
t.project = project
t.subject = "Test initial journal"
t.tracker = project.trackers.first
t.author = User.generate!
t.description = "Some content"
end
begin
oldstdout = $stdout
$stdout = StringIO.new
ticket.save!
assert $stdout.string.empty?, "No errors should be logged to stdout."
ensure
$stdout = oldstdout
end
journal = ticket.journals.first
assert_equal IssueJournal, journal.class
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment