Sha256: 82a8c1fd3de312a65a85f56fd28e81cab569c809dd9ac3804f7575e6a73b7241

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class QuestionsControllerTest < ActionController::TestCase
  setup do
    @question = questions(:one)
  end

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

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

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

    assert_redirected_to question_path(assigns(:question))
  end

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

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

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

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

    assert_redirected_to questions_path
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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