Sha256: da7079681a931db96f0f81fab4e2d358f7ac2fb0ef77a67b6e4b50857d5eb7d2

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class EventsControllerTest < ActionController::TestCase
  setup do
    @event = events(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:events)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create event" do
    assert_difference('Event.count') do
      post :create, event: { date: @event.date, datetime: @event.datetime, time: @event.time }
    end

    assert_redirected_to event_path(assigns(:event))
  end

  test "should show event" do
    get :show, id: @event
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @event
    assert_response :success
  end

  test "should update event" do
    patch :update, id: @event, event: { date: @event.date, datetime: @event.datetime, time: @event.time }
    assert_redirected_to event_path(assigns(:event))
  end

  test "should destroy event" do
    assert_difference('Event.count', -1) do
      delete :destroy, id: @event
    end

    assert_redirected_to events_path
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
date_picker-0.0.9 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.8 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.7 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.6 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.5 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.4 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.3 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.2 test/dummy/test/controllers/events_controller_test.rb
date_picker-0.0.1 test/dummy/test/controllers/events_controller_test.rb