Skip to content

Commit

Permalink
Fix lookup context for admin view spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sfnelson committed Feb 5, 2024
1 parent f39b16e commit 442c73d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"devDependencies": {
"prettier": "^3.2.4"
"prettier": "^3.2.5"
}
}
5 changes: 4 additions & 1 deletion spec/views/admin/posts/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
collection = Admin::PostsController::Collection.new.apply(Post.all)
table = Katalyst::TableComponent.new(collection:)

render template: "admin/posts/index", locals: { collection:, table: }
# Workaround for https://github.com/rspec/rspec-rails/issues/2729
view.lookup_context.prefixes.prepend "admin/posts"

render locals: { collection:, table: }
end

it { expect(rendered).to have_css("th", text: "Name") }
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


prettier@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283"
integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==
prettier@^3.2.5:
version "3.2.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==

0 comments on commit 442c73d

Please sign in to comment.