Sha256: ad3f3b9aab688707a910482d2a44382b891a305d567a6005244c71ab6b0598f0

Contents?: true

Size: 636 Bytes

Versions: 9

Compression:

Stored size: 636 Bytes

Contents

require 'spec_helper'

describe Sunrise::DashboardController do
  render_views  
  
  before(:all) do
    @audit = FactoryGirl.create(:audit)
  end
  
  describe "admin" do
    login_admin
    
    it "should render index action" do
      get :index
      assigns(:events).should include(@audit)
      response.should render_template('index')
    end
  end
  
  describe "anonymous user" do
    it "should not render index action" do
      controller.should_not_receive(:index)
      get :index
    end
    
    it "should redirect to login page" do
      get :index
      response.should redirect_to "/users/sign_in"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sunrise-cms-0.5.3 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0.rc5 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0.rc4 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0.rc3 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0.rc2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.5.0.rc1 spec/controllers/sunrise/dashboard_controller_spec.rb