require 'test_helper'

class NoteFilesControllerTest < ActionController::TestCase
  setup do
    @note_file = note_files(:one)
  end

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

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

  test "should create note_file" do
    assert_difference('NoteFile.count') do
      post :create, note_file: { description: @note_file.description, file: @note_file.file, name: @note_file.name, slug: @note_file.slug }
    end

    assert_redirected_to note_file_path(assigns(:note_file))
  end

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

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

  test "should update note_file" do
    put :update, id: @note_file, note_file: { description: @note_file.description, file: @note_file.file, name: @note_file.name, slug: @note_file.slug }
    assert_redirected_to note_file_path(assigns(:note_file))
  end

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

    assert_redirected_to note_files_path
  end
end
