diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/helpers/reactions_helper_test.rb | 22 | ||||
-rw-r--r-- | test/system/reactions_test.rb | 2 |
2 files changed, 22 insertions, 2 deletions
diff --git a/test/helpers/reactions_helper_test.rb b/test/helpers/reactions_helper_test.rb index ab722e3ca..f2eb04b6d 100644 --- a/test/helpers/reactions_helper_test.rb +++ b/test/helpers/reactions_helper_test.rb @@ -106,6 +106,26 @@ class ReactionsHelperTest < ActionView::TestCase assert_select_in result, 'a.reaction-button[title=?]', expected_tooltip end + test 'reaction_button should be label less when no reactions' do + issue = issues(:issues_002) + + result = with_locale('en') do + reaction_button(issue) + end + assert_select_in result, 'a.reaction-button' do + assert_select 'span.icon-label', false + end + + # readonly + User.current = nil + result = with_locale('en') do + reaction_button(issue) + end + assert_select_in result, 'span.reaction-button.readonly' do + assert_select 'span.icon-label', false + end + end + test 'reaction_button should not count and display non-visible users' do issue2 = issues(:issues_002) @@ -130,7 +150,7 @@ class ReactionsHelperTest < ActionView::TestCase assert_select_in result, 'a.reaction-button[title]', false assert_select_in result, 'a.reaction-button' do - assert_select 'span.icon-label', '0' + assert_select 'span.icon-label', false end end diff --git a/test/system/reactions_test.rb b/test/system/reactions_test.rb index 01ba76832..8cf849320 100644 --- a/test/system/reactions_test.rb +++ b/test/system/reactions_test.rb @@ -126,7 +126,7 @@ class ReactionsSystemTest < ApplicationSystemTestCase # Remove the reaction within(reaction_button) { find('a.reacted').click } within(reaction_button) { assert_selector('a.reaction-button:not(.reacted)') } - assert_equal "0", reaction_button.text + assert_equal "", reaction_button.text assert_equal 0, expected_subject.reactions.count end end |