summaryrefslogtreecommitdiffstats
path: root/test/functional/news_controller_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/news_controller_test.rb')
-rw-r--r--test/functional/news_controller_test.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb
index f1ddfff71..686fada25 100644
--- a/test/functional/news_controller_test.rb
+++ b/test/functional/news_controller_test.rb
@@ -75,7 +75,7 @@ class NewsControllerTest < Redmine::ControllerTest
get(:show, :params => {:id => 1})
assert_response :success
assert_select 'p.breadcrumb a[href=?]', '/projects/ecookbook/news', :text => 'News'
- assert_select 'h2', :text => 'eCookbook first release !'
+ assert_select 'h2', :text => 'JS eCookbook first release !'
end
def test_show_should_show_attachments
@@ -106,6 +106,23 @@ class NewsControllerTest < Redmine::ControllerTest
assert_response :not_found
end
+ def test_show_should_display_reactions
+ @request.session[:user_id] = 1
+
+ get :show, params: { id: 1 }
+ assert_response :success
+ assert_select 'span[data-reaction-button-id=reaction_news_1] a.reaction-button.reacted'
+ assert_select 'span[data-reaction-button-id=reaction_comment_1] a.reaction-button'
+
+ # Should not display reactions when reactions feature is disabled.
+ with_settings reactions_enabled: '0' do
+ get :show, params: { id: 1 }
+
+ assert_response :success
+ assert_select 'span[data-reaction-button-id]', false
+ end
+ end
+
def test_get_new_with_project_id
@request.session[:user_id] = 2
get(:new, :params => {:project_id => 1})