Make component tests fail when using within
This way we avoid writing useless tests which always pass.
This commit is contained in:
@@ -18,6 +18,10 @@ module ViewComponent
|
|||||||
def sign_in(user)
|
def sign_in(user)
|
||||||
allow(controller).to receive(:current_user).and_return(user)
|
allow(controller).to receive(:current_user).and_return(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def within(...)
|
||||||
|
raise "`within` doesn't work in component tests. Use `page.find` instead."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user