From 56f0f2a13f6d4a8997878a8219992a2e3071b8cd Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Sun, 28 Jan 2024 18:58:52 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=97=20`Journal`:=20Writing=20Entries:?= =?UTF-8?q?=20Test=20adding=20`Entry#summary`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/zinc-collective/convene-journal/issues/2 - https://github.com/zinc-collective/convene-journal/issues/6 - https://github.com/zinc-collective/convene-journal/issues/4 Clearly, when I started https://github.com/zinc-collective/convene-journal/pull/8 I used the wrong name. It's not an `Entry#description`, it's an `Entry#summary`! Perhaps that would have been more obvious had I started with the spec, rather than the data model. Ah well, inside out and outside in are both valid. --- .../journal/writing_entries_system_spec.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spec/furniture/journal/writing_entries_system_spec.rb diff --git a/spec/furniture/journal/writing_entries_system_spec.rb b/spec/furniture/journal/writing_entries_system_spec.rb new file mode 100644 index 000000000..6cfeba58d --- /dev/null +++ b/spec/furniture/journal/writing_entries_system_spec.rb @@ -0,0 +1,25 @@ +require "rails_helper" + +# @see https://github.com/zinc-collective/convene-journal/issues/2 +RSpec.describe "Writing Entries", type: :system do + let(:space) { create(:space, :with_entrance, :with_members) } + let(:journal) { create(:journal, room: space.entrance) } + + before do + sign_in(space.members.first, space) + end + + it "Entries have a customizable feed-forward summary for browsing, search and sharing" do + visit(polymorphic_path(journal.location(:new, child: :entry))) + + fill_in("Body", with: 1000.times.map { Faker::Books::Dune.quote }.join("\r\n\r\n")) + summary = %( + So you thought you wanted 1000 Dune Quotes? + Well, you were wrong. But here they are anyway! + ) + fill_in("Summary", with: summary) + + visit(polymorphic_path(space.entrance.location)) + expect(page).to have_content("Summary") + end +end