require 'test_helper'

class VideasControllerTest < ActionController::TestCase
  setup do
    @videa = videas(:one)
  end

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

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

  test "should create videa" do
    assert_difference('Videa.count') do
      post :create, videa: @videa.attributes
    end

    assert_redirected_to videa_path(assigns(:videa))
  end

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

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

  test "should update videa" do
    put :update, id: @videa, videa: @videa.attributes
    assert_redirected_to videa_path(assigns(:videa))
  end

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

    assert_redirected_to videas_path
  end
end
