require 'test_helper'

class MenulinksControllerTest < ActionController::TestCase
  setup do
    @menulink = menulinks(:one)
  end

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

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

  test "should create menulink" do
    assert_difference('Menulink.count') do
      post :create, menulink: { object_url: @menulink.object_url, position: @menulink.position, title: @menulink.title }
    end

    assert_redirected_to menulink_path(assigns(:menulink))
  end

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

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

  test "should update menulink" do
    put :update, id: @menulink, menulink: { object_url: @menulink.object_url, position: @menulink.position, title: @menulink.title }
    assert_redirected_to menulink_path(assigns(:menulink))
  end

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

    assert_redirected_to menulinks_path
  end
end
