Sha256: 82c5918d46cce1b7058b287b704b1687d907889e5e540dbf2350f33b65986587

Contents?: true

Size: 1 KB

Versions: 27

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

class BeaversControllerTest < ActionController::TestCase
  setup do
    @beaver = beavers(:one)
  end

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

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

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

    assert_redirected_to beaver_path(assigns(:beaver))
  end

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

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

  test "should update beaver" do
    patch :update, id: @beaver, beaver: { name: @beaver.name }
    assert_redirected_to beaver_path(assigns(:beaver))
  end

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

    assert_redirected_to beavers_path
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
rabbit_feed-2.4.4 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.4.3 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.4.2 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.4.1 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.4.0 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.10 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.9 example/rails_app/test/controllers/beavers_controller_test.rb
flip_fab-1.0.1 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.7 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.6 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.5 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.4 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.3 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.2 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.1 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.3.0 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.1.5 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.1.2 example/rails_app/test/controllers/beavers_controller_test.rb
flip_fab-1.0.0 example/rails_app/test/controllers/beavers_controller_test.rb
rabbit_feed-2.1.1 example/rails_app/test/controllers/beavers_controller_test.rb