Sha256: 8b71a0dffb965c5b7b27be5ec48dd57af7939d1ac49ec558d24be72a628ceb05

Contents?: true

Size: 1.63 KB

Versions: 30

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

describe CalendarController do
  fixtures :all

  describe "GET index", :solr => true do
    describe "When logged in as Administrator" do
      login_admin

      it "assigns all event_stripss as @event_stripss" do
        get :index
        assigns(:event_strips).should_not be_empty
      end
    end

    describe "When not logged in" do
      it "assigns all event_stripss as @event_stripss" do
        get :index
        assigns(:event_strips).should_not be_empty
      end

      it "should get index when a year and a month are set" do
        get :index, :year => 2010, :month => 3
        response.should be_success
        assigns(:event_strips).should_not be_empty
      end

      it "should redirect to a new event if no event is present" do
        get :show, :year => 2010, :month => 3, :day => 1
        response.should redirect_to new_event_path(:date => '2010/03/01')
      end

      it "should redirect to an existing event" do
        get :show, :year => 2008, :month => 1, :day => 13
        response.should redirect_to events_path(:date => '2008/01/13')
      end
    end
  end

  describe "GET show" do
    describe "When logged in as Administrator" do
      login_admin

      it "should redirect to a new event" do
        get :show, :year => '2011', :month => '1', :day => '1'
        response.should redirect_to(new_event_path(:date => '2011/01/01'))
      end
    end

    describe "When not logged in" do
      it "should redirect to a new event" do
        get :show, :year => '2011', :month => '1', :day => '1'
        response.should redirect_to(new_event_path(:date => '2011/01/01'))
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
enju_event-0.0.27 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.26 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.25 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.12 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.11 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.24 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.23 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.10 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.9 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.22 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.21 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.8 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.20 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.7 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.19 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.6 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.18 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.17 spec/controllers/calendar_controller_spec.rb
enju_event-0.1.5 spec/controllers/calendar_controller_spec.rb
enju_event-0.0.16 spec/controllers/calendar_controller_spec.rb