Sha256: 3e062e1cbb930ff004a325f1512ca6918b4b2322eb2c31ce8eaa34d4524988ca

Contents?: true

Size: 920 Bytes

Versions: 2

Compression:

Stored size: 920 Bytes

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
refinerycms-varnish-pages-0.0.3.rc1 spec/controllers/admin/pages_controller_spec.rb
refinerycms-varnish-pages-0.0.2.2 spec/controllers/admin/pages_controller_spec.rb