require 'test_helper'

class LinkBannersControllerTest < ActionController::TestCase
  setup do
    @link_banner = link_banners(:one)
  end

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

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

  test "should create link_banner" do
    assert_difference('LinkBanner.count') do
      post :create, link_banner: { beginning: @link_banner.beginning, category_id: @link_banner.category_id, checkout_page: @link_banner.checkout_page, ending: @link_banner.ending, footer: @link_banner.footer, header: @link_banner.header, image_url: @link_banner.image_url, item_id: @link_banner.item_id, link_url: @link_banner.link_url, search_result_page: @link_banner.search_result_page, section_id: @link_banner.section_id, start_page: @link_banner.start_page, sub_category_id: @link_banner.sub_category_id, thank_you_page: @link_banner.thank_you_page }
    end

    assert_redirected_to link_banner_path(assigns(:link_banner))
  end

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

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

  test "should update link_banner" do
    patch :update, id: @link_banner, link_banner: { beginning: @link_banner.beginning, category_id: @link_banner.category_id, checkout_page: @link_banner.checkout_page, ending: @link_banner.ending, footer: @link_banner.footer, header: @link_banner.header, image_url: @link_banner.image_url, item_id: @link_banner.item_id, link_url: @link_banner.link_url, search_result_page: @link_banner.search_result_page, section_id: @link_banner.section_id, start_page: @link_banner.start_page, sub_category_id: @link_banner.sub_category_id, thank_you_page: @link_banner.thank_you_page }
    assert_redirected_to link_banner_path(assigns(:link_banner))
  end

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

    assert_redirected_to link_banners_path
  end
end
