From 64e2bca8326bd46a2ad80b6a7a430dea0f81ff6b Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 14 Mar 2024 11:34:28 +0100 Subject: Added rubocop-minitest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- test/system/comments_test.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'test/system/comments_test.rb') diff --git a/test/system/comments_test.rb b/test/system/comments_test.rb index b2490b4..33a1398 100644 --- a/test/system/comments_test.rb +++ b/test/system/comments_test.rb @@ -12,9 +12,11 @@ class CommentsTest < ApplicationSystemTestCase visit thing_url(things(:thing1)) click_on I18n.t('comments.new') + assert_text I18n.t('tags.new-action'), count: 1 click_on I18n.t('general.cancel') + assert_text I18n.t('tags.new-action'), count: 0 end @@ -28,10 +30,9 @@ class CommentsTest < ApplicationSystemTestCase click_on I18n.t('helpers.submit.create') - assert_text "#{I18n.t('comments.title')} #2" assert_text 'a new comment' assert_text "#{I18n.t('tags.title')}: #{tags(:tag1).name}, #{tags(:tag2).name}" - assert page.current_path == thing_path(things(:thing1)) + assert_equal page.current_path, thing_path(things(:thing1)) end test 'things#show: you can update a comment' do @@ -41,16 +42,18 @@ class CommentsTest < ApplicationSystemTestCase find(:css, '#comment_content').set('updated comment') find("#comment_#{comments(:comment1).id} input[type=submit]").click + assert_text 'updated comment' - assert page.current_path == thing_path(things(:thing1)) + assert_equal page.current_path, thing_path(things(:thing1)) end test 'things#show: you can delete a comment' do visit thing_url(things(:thing1)) all('.delete-comment').last.click + assert_text I18n.t('comments.none') - assert page.current_path == thing_path(things(:thing1)) + assert_equal page.current_path, thing_path(things(:thing1)) end ## @@ -60,9 +63,11 @@ class CommentsTest < ApplicationSystemTestCase visit edit_thing_url(things(:thing1)) click_on I18n.t('comments.new') + assert_text I18n.t('tags.new-action'), count: 2 click_on I18n.t('general.cancel') + assert_text I18n.t('tags.new-action'), count: 1 end @@ -76,10 +81,9 @@ class CommentsTest < ApplicationSystemTestCase click_on I18n.t('helpers.submit.create') - assert_text "#{I18n.t('comments.title')} #2" assert_text 'a new comment' assert_text "#{I18n.t('tags.title')}: #{tags(:tag1).name}, #{tags(:tag2).name}" - assert page.current_path == edit_thing_path(things(:thing1)) + assert_equal page.current_path, edit_thing_path(things(:thing1)) end test 'things#edit: you can update a comment' do @@ -89,15 +93,17 @@ class CommentsTest < ApplicationSystemTestCase find(:css, '#comment_content').set('updated comment') find("#comment_#{comments(:comment1).id} input[type=submit]").click + assert_text 'updated comment' - assert page.current_path == edit_thing_path(things(:thing1)) + assert_equal page.current_path, edit_thing_path(things(:thing1)) end test 'things#edit: you can delete a comment' do visit edit_thing_url(things(:thing1)) all('.delete-comment').last.click + assert_text I18n.t('comments.none') - assert page.current_path == edit_thing_path(things(:thing1)) + assert_equal page.current_path, edit_thing_path(things(:thing1)) end end -- cgit v1.2.3