From 4ff6027926d90509342b9b973834c8ca63357db9 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 6 Sep 2017 11:31:21 +0100 Subject: [PATCH] Check that the flag is not show when not logged in --- test/features/report_diary_entry_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/features/report_diary_entry_test.rb b/test/features/report_diary_entry_test.rb index aaa89ad5b..820b5f77b 100644 --- a/test/features/report_diary_entry_test.rb +++ b/test/features/report_diary_entry_test.rb @@ -6,6 +6,13 @@ class ReportDiaryEntryTest < Capybara::Rails::TestCase @diary_entry = create(:diary_entry) end + def test_no_flag_when_not_logged_in + visit diary_entry_path(@diary_entry.user.display_name, @diary_entry) + assert page.has_content?(@diary_entry.title) + + assert !page.has_content?("\u2690") + end + def test_it_works sign_in_as(create(:user)) visit diary_entry_path(@diary_entry.user.display_name, @diary_entry) -- 2.39.5