Sha256: 28a57e9fe4ed72841652d684ed05f446609cb1f98aee46aafe06f6fd6100a48e

Contents?: true

Size: 1.45 KB

Versions: 10

Compression:

Stored size: 1.45 KB

Contents

require 'test_helper'

class DestinationsControllerTest < ActionController::TestCase
  setup do
    @destination = destinations(:one)
  end

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

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

  test "should create destination" do
    assert_difference('Destination.count') do
      post :create, :destination => { :address1 => @destination.address1, :address2 => @destination.address2, :city => @destination.city, :phone => @destination.phone, :state => @destination.state, :zip => @destination.zip }
    end

    assert_redirected_to destination_path(assigns(:destination))
  end

  test "should show destination" do
    get :show, :id => @destination
    assert_response :success
  end

  test "should get edit" do
    get :edit, :id => @destination
    assert_response :success
  end

  test "should update destination" do
    put :update, :id => @destination, :destination => { :address1 => @destination.address1, :address2 => @destination.address2, :city => @destination.city, :phone => @destination.phone, :state => @destination.state, :zip => @destination.zip }
    assert_redirected_to destination_path(assigns(:destination))
  end

  test "should destroy destination" do
    assert_difference('Destination.count', -1) do
      delete :destroy, :id => @destination
    end

    assert_redirected_to destinations_path
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hashbrowns-0.2.5 example/test/functional/destinations_controller_test.rb
hashbrowns-0.2.4 example/test/functional/destinations_controller_test.rb
hashbrowns-0.2.3 example/test/functional/destinations_controller_test.rb
hashbrowns-0.2.2 example/test/functional/destinations_controller_test.rb
hashbrowns-0.2.1 example/test/functional/destinations_controller_test.rb
hashbrowns-0.2.0 example/test/functional/destinations_controller_test.rb
hashbrowns-0.1.6 example/test/functional/destinations_controller_test.rb
hashbrowns-0.1.5 example/test/functional/destinations_controller_test.rb
hashbrowns-0.1.4 example/test/functional/destinations_controller_test.rb
hashbrowns-0.1.3 example/test/functional/destinations_controller_test.rb