require 'test_helper'

class KidungsControllerTest < ActionController::TestCase
  setup do
    @kidung = kidungs(:one)
  end

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

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

  test "should create kidung" do
    assert_difference('Kidung.count') do
      post :create, kidung: { content: @kidung.content, number: @kidung.number, tipe: @kidung.tipe }
    end

    assert_redirected_to kidung_path(assigns(:kidung))
  end

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

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

  test "should update kidung" do
    patch :update, id: @kidung, kidung: { content: @kidung.content, number: @kidung.number, tipe: @kidung.tipe }
    assert_redirected_to kidung_path(assigns(:kidung))
  end

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

    assert_redirected_to kidungs_path
  end
end
