Sha256: 4917d4933ddb0c2ff31e1482587487e58df01549a9484b6e44585932acd27b4a

Contents?: true

Size: 1.31 KB

Versions: 7

Compression:

Stored size: 1.31 KB

Contents

require 'test_helper'

class PublishersControllerTest < ActionController::TestCase
  setup do
    @publisher = publishers(:one)
  end

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

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

  test "should create publisher" do
    assert_difference('Publisher.count') do
      post :create, publisher: { category_id: @publisher.category_id, description: @publisher.description, email: @publisher.email, name: @publisher.name, url: @publisher.url }
    end

    assert_redirected_to publisher_path(assigns(:publisher))
  end

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

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

  test "should update publisher" do
    patch :update, id: @publisher, publisher: { category_id: @publisher.category_id, description: @publisher.description, email: @publisher.email, name: @publisher.name, url: @publisher.url }
    assert_redirected_to publisher_path(assigns(:publisher))
  end

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

    assert_redirected_to publishers_path
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
epom_rails-1.4.4 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.4.2 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.4.1 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.4.0 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.3.6 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.3.5 test/dummy/test/controllers/publishers_controller_test.rb
epom_rails-1.3.2 test/dummy/test/controllers/publishers_controller_test.rb