Sha256: 218c3f2b7b61bb4f0fb5235e4398c50766b146bdff7777f95ebd41f1a969781a

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

class LinksControllerTest < ActionController::TestCase
  setup do
    @link = links(:one)
  end

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

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

  test "should create link" do
    assert_difference('Link.count') do
      post :create, :link => @link.attributes
    end

    assert_redirected_to link_path(assigns(:link))
  end

  test "should show link" do
    get :show, :id => @link.to_param
    assert_response :success
  end

  test "should get edit" do
    get :edit, :id => @link.to_param
    assert_response :success
  end

  test "should update link" do
    put :update, :id => @link.to_param, :link => @link.attributes
    assert_redirected_to link_path(assigns(:link))
  end

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

    assert_redirected_to links_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
to_permalink-0.0.3 test/dummy/test/functional/links_controller_test.rb
to_permalink-0.0.2 test/dummy/test/functional/links_controller_test.rb