require 'spec_helper' describe Admin::PagesController, :type => :request do def reset @page.destroy! if @page @page = Page.create!({ :title => "RSpec is great for testing too", :deletable => true }) end before(:each) do reset end login_refinery_user it "should be able to access admin area" do ActionController::Base.should_receive(:purge).with('/rspec-is-great-for-testing-too') get :update, :id => '1' end context "with 'always_purge_path' set" do before(:each) do RefinerySetting.delete_all RefinerySetting.set(:always_purge_path, '/preview') end it "should purge page url and always_purge_path" do ActionController::Base.should_receive(:purge).with("/rspec-is-great-for-testing-too") ActionController::Base.should_receive(:purge).with("/preview") get :update, :id => '1' end end end