Sha256: 1d66ccc271f541c45b7828ee7b0530f184bfa976545e732d6c3d11acbc3a9107

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class PhonesControllerTest < ActionController::TestCase

  setup do
    @phone = phones(:valid_and_possible)
    Phonelib.default_country = nil
  end

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

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

  test "should create phone" do
    assert_difference('Phone.count') do
      post :create, phone: { number: @phone.number }
    end

    assert_redirected_to phone_path(assigns(:phone))
  end

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

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

  test "should update phone" do
    put :update, id: @phone, phone: { number: @phone.number }
    assert_redirected_to phone_path(assigns(:phone))
  end

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

    assert_redirected_to phones_path
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
phonelib-0.2.7 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.6 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.5 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.4 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.3 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.2 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.1 test/dummy/test/functional/phones_controller_test.rb
phonelib-0.2.0 test/dummy/test/functional/phones_controller_test.rb