Skip to content

Commit

Permalink
Merge 84448a7 into de59800
Browse files Browse the repository at this point in the history
  • Loading branch information
aiomaster committed Aug 20, 2018
2 parents de59800 + 84448a7 commit 0314e15
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/app/views/refinery/admin/pages/_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
</div>

<%= content_tag :ul, class: 'nested', data: { 'ajax-content': refinery.admin_children_pages_path(page.nested_url) } do %>
<%= render(partial: 'page', collection: page.children, cached: true) if Refinery::Pages.auto_expand_admin_tree %>
<%= render(partial: 'page', collection: page.children, cached: ->(child_page) { child_page.self_and_descendants }) if Refinery::Pages.auto_expand_admin_tree %>
<% end %>
</li>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_tag :ul, id: 'sortable_list' do %>
<%= render partial: 'page', collection: @pages.roots, cached: true %>
<%= render partial: 'page', collection: @pages.roots, cached: ->(child_page) { child_page.self_and_descendants } %>
<% end %>
<%= render '/refinery/admin/sortable_list', continue_reordering: !!local_assigns[:continue_reordering] %>
2 changes: 1 addition & 1 deletion pages/app/views/refinery/admin/pages/children.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= render partial: 'page', collection: @page.children, cached: true %>
<%= render partial: 'page', collection: @page.children, cached: ->(child_page) { child_page.self_and_descendants } %>
7 changes: 7 additions & 0 deletions pages/spec/features/refinery/admin/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ module Admin
expect(page).to have_content(team.title)
expect(page).to have_content(locations.title)
end

it "refreshes the cache if sub_children change" do
expect(page).to have_content(location.title)
location.update(title: 'Las Vegas')
visit refinery.admin_pages_path
expect(page).to have_content(location.title)
end
end
end
end
Expand Down

0 comments on commit 0314e15

Please sign in to comment.