Sha256: edbc429fcde8a3078febe155b947761d89ce0436b3ba211acc33032341b0f80b

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

require 'test_helper'

module Wafflemix
  class PortfoliosControllerTest < ActionController::TestCase
    setup do
      @portfolio = portfolios(:one)
    end
  
    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:portfolios)
    end
  
    test "should get new" do
      get :new
      assert_response :success
    end
  
    test "should create portfolio" do
      assert_difference('Portfolio.count') do
        post :create, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
      end
  
      assert_redirected_to portfolio_path(assigns(:portfolio))
    end
  
    test "should show portfolio" do
      get :show, id: @portfolio
      assert_response :success
    end
  
    test "should get edit" do
      get :edit, id: @portfolio
      assert_response :success
    end
  
    test "should update portfolio" do
      put :update, id: @portfolio, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
      assert_redirected_to portfolio_path(assigns(:portfolio))
    end
  
    test "should destroy portfolio" do
      assert_difference('Portfolio.count', -1) do
        delete :destroy, id: @portfolio
      end
  
      assert_redirected_to portfolios_path
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wafflemix-0.0.6 test/functional/wafflemix/portfolios_controller_test.rb
wafflemix-0.0.5 test/functional/wafflemix/portfolios_controller_test.rb
wafflemix-0.0.4 test/functional/wafflemix/portfolios_controller_test.rb
wafflemix-0.0.3 test/functional/wafflemix/portfolios_controller_test.rb
wafflemix-0.0.2 test/functional/wafflemix/portfolios_controller_test.rb
wafflemix-0.0.1 test/functional/wafflemix/portfolios_controller_test.rb