diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-06-14 09:19:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-06-14 09:19:20 +0000 |
commit | 7642b5a9ab180aaedee24c6b4e38eb28cafd00b3 (patch) | |
tree | d7fb81525f680c62019c425ae29ecde4149e7b7f /test/unit/message_test.rb | |
parent | 5e76040256c4a86485caf010cc9c9c8329e7aafa (diff) | |
download | redmine-7642b5a9ab180aaedee24c6b4e38eb28cafd00b3.tar.gz redmine-7642b5a9ab180aaedee24c6b4e38eb28cafd00b3.zip |
Fixed: editing a message may cause sticky attribute to be NULL (#3356).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2787 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/message_test.rb')
-rw-r--r-- | test/unit/message_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/message_test.rb b/test/unit/message_test.rb index d88e98bcf..09857fbc9 100644 --- a/test/unit/message_test.rb +++ b/test/unit/message_test.rb @@ -128,4 +128,19 @@ class MessageTest < Test::Unit::TestCase author.roles_for_project(message.project).first.remove_permission!(:delete_own_messages) assert !message.reload.destroyable_by?(author.reload) end + + def test_set_sticky + message = Message.new + assert_equal 0, message.sticky + message.sticky = nil + assert_equal 0, message.sticky + message.sticky = false + assert_equal 0, message.sticky + message.sticky = true + assert_equal 1, message.sticky + message.sticky = '0' + assert_equal 0, message.sticky + message.sticky = '1' + assert_equal 1, message.sticky + end end |