-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🥗
Gizmo
: System Spec to Add and Remove Gizmo
- #1565 For whatever reason the automated check doesn't *FAIL* despite it failing when we manually execute it! Add Firefox to the RSpec tests Run in Headless mode on CI Don't send real emails in CI save screenshots yo Add the .env.development to the devcontaine Add Firefox to the RSpec tests Run in Headless mode on CI Don't send real emails in CI save screenshots yo
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require "rails_helper" | ||
|
||
# @see https://github.com/zinc-collective/convene/issues/709 | ||
describe "Furniture" do | ||
include ActiveJob::TestHelper | ||
it "Managing Furniture" do | ||
space = create(:space, :with_entrance, :with_members, member_count: 1) | ||
# Sign in to the Space | ||
sign_in(space.members.first, space) | ||
|
||
add_gizmo("Markdown Text Block", room: space.entrance) | ||
remove_gizmo("Markdown Text Block", room: space.entrance) | ||
|
||
visit(polymorphic_path(space.entrance.location(:edit))) | ||
expect(page).to have_text("No gizmos yet.") | ||
end | ||
|
||
def sign_in(user, space) | ||
visit(polymorphic_path(space.location)) | ||
click_link_or_button("Sign in") | ||
fill_in("authenticated_session[contact_location]", with: user.email) | ||
find('input[type="submit"]').click | ||
perform_enqueued_jobs | ||
|
||
visit(URI.parse(URI.extract(ActionMailer::Base.deliveries.first.body.to_s)[1]).request_uri) | ||
end | ||
|
||
def add_gizmo(type, room:) | ||
visit(polymorphic_path(room.location(:edit))) | ||
select(type, from: "Type of gizmo") | ||
click_link_or_button("Add Gizmo") | ||
end | ||
|
||
def remove_gizmo(type, room:) | ||
visit(polymorphic_path(room.location(:edit))) | ||
expect(page).to have_text("Markdown Text Block") | ||
within("##{ActionView::RecordIdentifier.dom_id(room.gizmos.first)}") do | ||
click_link_or_button "Configure Markdown Text Block" | ||
end | ||
click_link_or_button "Remove Gizmo" | ||
end | ||
end |