Sha256: 90c728da89a22165c95586193590a3528103194b9fc50d4b5501f26ddf5353a2

Contents?: true

Size: 755 Bytes

Versions: 16

Compression:

Stored size: 755 Bytes

Contents

require 'spec_helper'

describe Sunrise::DashboardController do
  render_views  
  
  before(:all) do
    @post = FactoryGirl.create(:post)
    @user = FactoryGirl.create(:redactor_user)
    @event = @post.create_activity :key => 'post.create', :owner => @user
  end
  
  describe "admin" do
    login_admin
    
    it "should render index action" do
      get :index
      assigns(:events).should include(@event)
      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

16 entries across 16 versions & 1 rubygems

Version Path
sunrise-cms-1.0.0.rc2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-1.0.0.rc1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.7.0.rc2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.7.0.rc1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.11 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.10 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.9 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.8 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.7 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.6 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.5 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.4 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.3 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.2 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.1 spec/controllers/sunrise/dashboard_controller_spec.rb
sunrise-cms-0.6.0 spec/controllers/sunrise/dashboard_controller_spec.rb