Sha256: 7231b610b32e215db412cbd42930230f3a5b54ab0a082d7b2ddda1de4ab9de82

Contents?: true

Size: 637 Bytes

Versions: 9

Compression:

Stored size: 637 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.4.2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.4.1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.4.0 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.3 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.0 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.0.rc2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.3.0.rc spec/controllers/sunrise/dashboard_controller_spec.rb