Module: CachingHelpers

Defined in:
pages/spec/support/refinery/pages/caching_helpers.rb

Instance Method Summary collapse

Instance Method Details

#cache_page(page) ⇒ Object


10
11
12
13
14
# File 'pages/spec/support/refinery/pages/caching_helpers.rb', line 10

def cache_page(page)
  allow_any_instance_of(Refinery::PagesController).to receive(:refinery_user?).and_return(false)
  visit refinery.page_path(page)
  allow_any_instance_of(Refinery::PagesController).to receive(:refinery_user?).and_call_original
end

#cached_directoryObject


2
3
4
# File 'pages/spec/support/refinery/pages/caching_helpers.rb', line 2

def cached_directory
  "spec/dummy/public/refinery/cache/pages"
end

#cached_file_path(page) ⇒ Object


6
7
8
# File 'pages/spec/support/refinery/pages/caching_helpers.rb', line 6

def cached_file_path(page)
  "#{cached_directory}#{refinery.page_path(page)}.html"
end