require 'test_helper'

class JamSessionsControllerTest < ActionController::TestCase
  setup do
    @jam_session = jam_sessions(:one)
  end

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

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

  test "should create jam_session" do
    assert_difference('JamSession.count') do
      post :create, jam_session: { name: @jam_session.name }
    end

    assert_redirected_to jam_session_path(assigns(:jam_session))
  end

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

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

  test "should update jam_session" do
    put :update, id: @jam_session, jam_session: { name: @jam_session.name }
    assert_redirected_to jam_session_path(assigns(:jam_session))
  end

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

    assert_redirected_to jam_sessions_path
  end
end
