Sha256: c2d14200d1786cb07de4f5ccc380aeac85869b8a3017d173d08c486bbadc010c

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'

class LocationsControllerTest < ActionController::TestCase
  setup do
    @location = locations(:one)
  end

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

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

  test "should create location" do
    assert_difference('Location.count') do
      post :create, location: { name: @location.name }
    end

    assert_redirected_to location_path(assigns(:location))
  end

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

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

  test "should update location" do
    put :update, id: @location, location: { name: @location.name }
    assert_redirected_to location_path(assigns(:location))
  end

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

    assert_redirected_to locations_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts-as-taggable-on-dynamic-0.0.3 samples/demo-plain/test/functional/locations_controller_test.rb
acts-as-taggable-on-dynamic-0.0.2 samples/demo-plain/test/functional/locations_controller_test.rb