Appending to a post's tags in tests
hasandiwan opened this issue · 1 comments
I'm attempting to add openpgp-signed StatusUpdates to diaspora, if there's a 'signed' tag:
`
if @s.tag_list.member?('signed') then
pgp_sign @s
end
@s.save!
`
It's quite straightforward to code, but I'd now like to verify this functionality works. What I have so far is:
`
@s.tag_list = ActsAsTaggableOn::TagList.new(:signed)
@s.tag_list
@s.tag_list
=> ["signed"]
@s.save!
@s.reload
@s.tag_list
=> []
`
Huh?
The forum might be a little bit better avenue for such talk than the issue tracker :)
StatusMessage
includes Diaspora::Taggable
diaspora/app/models/status_message.rb
Line 8 in 37a7c0b
Which defines a before validation hook
diaspora/lib/diaspora/taggable.rb
Line 25 in 37a7c0b
that sets the tag list from what's parsed from the message body
diaspora/lib/diaspora/taggable.rb
Lines 36 to 45 in 37a7c0b
In other words a message's tags are not meant to be a generic metadata attachment system, they're purely there to support the hashtagging feature.