Sha256: 61ce61cc6162cae7046f87b83c4e15b7ee4e8dd7b248a0b6abdb4d98a9b16261

Contents?: true

Size: 910 Bytes

Versions: 3

Compression:

Stored size: 910 Bytes

Contents

require 'test_helper'

class BarsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @bar = bars(:one)
  end

  test "should get index" do
    get bars_url
    assert_response :success
  end

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

  test "should create bar" do
    assert_difference('Bar.count') do
      post bars_url, params: { bar: {  } }
    end

    assert_redirected_to bar_url(Bar.last)
  end

  test "should show bar" do
    get bar_url(@bar)
    assert_response :success
  end

  test "should get edit" do
    get edit_bar_url(@bar)
    assert_response :success
  end

  test "should update bar" do
    patch bar_url(@bar), params: { bar: {  } }
    assert_redirected_to bar_url(@bar)
  end

  test "should destroy bar" do
    assert_difference('Bar.count', -1) do
      delete bar_url(@bar)
    end

    assert_redirected_to bars_url
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sandboxy-1.1.1 examples/rails_example/test/controllers/bars_controller_test.rb
sandboxy-1.1.0 examples/rails_example/test/controllers/bars_controller_test.rb
sandboxy-1.0.0 examples/rails_example/test/controllers/bars_controller_test.rb