require 'test_helper'

class Test::OnesControllerTest < ActionController::TestCase
  setup do
    @test_one = test_ones(:one)
  end

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

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

  test "should create test_one" do
    assert_difference('Test::One.count') do
      post :create, test_one: { account_id: @test_one.account_id, else: @test_one.else, name: @test_one.name, something: @test_one.something, status: @test_one.status }
    end

    assert_redirected_to test_one_path(assigns(:test_one))
  end

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

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

  test "should update test_one" do
    patch :update, id: @test_one, test_one: { account_id: @test_one.account_id, else: @test_one.else, name: @test_one.name, something: @test_one.something, status: @test_one.status }
    assert_redirected_to test_one_path(assigns(:test_one))
  end

  test "should destroy test_one" do
    assert_difference('Test::One.count', -1) do
      delete :destroy, id: @test_one
    end

    assert_redirected_to test_ones_path
  end
end
