-
-
Notifications
You must be signed in to change notification settings - Fork 465
Open
Description
I'm struggling with adding clearance to my system tests.
class PiecesTest < ApplicationSystemTestCase
setup do
@writer = writers(:one)
@piece = pieces(:one)
@fields = {
draft: t("activerecord.attributes.piece.draft"),
prose: t("activerecord.attributes.piece.prose"),
title: t("activerecord.attributes.piece.title"),
word_count: t("activerecord.attributes.piece.word_count_suffix"),
}
end
test "should add a new prose piece" do
visit pieces_url(as: @writer)
click_on t("pieces.actions.new"), match: :first
check @fields[:prose]
fill_in @fields[:word_count], with: 5000
fill_in @fields[:title], with: "Prose Piece"
fill_in @fields[:draft], with: 1
click_on t("pieces.actions.submit")
assert_text t("pieces.actions.created")
end
endThe backdoor middleware, will only work for the visit call (the first line of the test). It doesn't work with redirects, like the one generated by the click in the second line of the test.
The controller test helpers are also not available if I require "clearance/test_unit".
What else can I try to get this to work?
Metadata
Metadata
Assignees
Labels
No labels