Sha256: 0ece6b4314c9d77d37de014be35561f3c5753cc6dcea4da6bbeb358785042700

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

class ZonesControllerTest < ActionController::TestCase
  setup do
    @zone = zones(:two)
  end

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

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

  test "should create zone" do
    assert_difference('Zone.count') do
      post :create, zone: { description: @zone.description, epom_id: @zone.epom_id, name: @zone.name, publisher_id: @zone.publisher_id }
    end

    assert_redirected_to zone_path(assigns(:zone))
  end

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

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

  test "should update zone" do
    patch :update, id: @zone, zone: { description: @zone.description, epom_id: @zone.epom_id, name: @zone.name, publisher_id: @zone.publisher_id }
    assert_redirected_to zone_path(assigns(:zone))
  end

  test "should destroy zone" do
    @zone.epom_id = nil
    @zone.save
    assert_difference('Zone.count', -1) do
      delete :destroy, id: @zone
    end

    assert_redirected_to zones_path
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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