Sha256: 5537938be21458c173c4fbdf7e2e14f81b48c50c0697f6fe87621ef96a855d2d

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

require 'test_helper'

class AnswersControllerTest < ActionController::TestCase
  setup do
    @answer = answers(:one)
  end

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

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

  test "should create answer" do
    assert_difference('Answer.count') do
      post :create, answer: @answer.attributes
    end

    assert_redirected_to answer_path(assigns(:answer))
  end

  test "should show answer" do
    get :show, id: @answer.to_param
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @answer.to_param
    assert_response :success
  end

  test "should update answer" do
    put :update, id: @answer.to_param, answer: @answer.attributes
    assert_redirected_to answer_path(assigns(:answer))
  end

  test "should destroy answer" do
    assert_difference('Answer.count', -1) do
      delete :destroy, id: @answer.to_param
    end

    assert_redirected_to answers_path
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ask-0.4.1 test/functional/answers_controller_test.rb
ask-0.4.0 test/functional/answers_controller_test.rb
ask-0.3.1 test/functional/answers_controller_test.rb
ask-0.3.0 test/functional/answers_controller_test.rb
ask-0.2.0 test/functional/answers_controller_test.rb
ask-0.1.2 test/functional/answers_controller_test.rb
ask-0.1.1 test/functional/answers_controller_test.rb
ask-0.1.0 test/functional/answers_controller_test.rb