]> cat aescling's git repositories - mastodon.git/commit
Add test coverage to CSS class generation (#2285)
authorJoël Quenneville <joel.quen@gmail.com>
Sun, 23 Apr 2017 04:04:32 +0000 (00:04 -0400)
committerEugen <eugen@zeonfederated.com>
Sun, 23 Apr 2017 04:04:32 +0000 (06:04 +0200)
commit0c2fe22bc19a82899c7577410bc869db7d42955a
tree10961704fdb4a80524a00cd180864c3d9a16e578
parent6f0b3b069f3ee9a9eceec77666fc124b9695f124
Add test coverage to CSS class generation (#2285)

The code that generates CSS is based on a lot of boolean conditions.
The possible combinations of these grows exponentially as we add more
conditions.

Since most of the code is conditional on a single boolean, we tested the
following:

1. All `false`
2. All `true`
3. Each individual flag set to `true`

The methods tested are:

* `StreamEntriesHelper#style_classes`
* `StreamEntriesHelper#microformats_classes`
* `StreamEntriesHelper#microformats_h_class`
app/helpers/stream_entries_helper.rb
spec/helpers/stream_entries_helper_spec.rb