SHARE
TWEET

Untitled

a guest Mar 17th, 2018 272 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'test_helper'
  2.  
  3. class AccountsControllerTest < ActionController::TestCase
  4.  
  5.   def setup
  6.     @valid_params = {:username => "foo",
  7.                      :password => "secret",
  8.                      :password_confirmation => "secret",
  9.                      :email => "foo@example.com"}
  10.   end
  11.    
  12.   def test_new
  13.     get :new
  14.     assert_template 'new'
  15.   end
  16.  
  17.   def test_create_invalid
  18.     post :create, :account => {}
  19.     assert_template 'new'
  20.   end
  21.  
  22.   def test_create_valid
  23.     post :create, :account => @valid_params
  24.     assert_redirected_to root_url
  25.     assert_equal assigns['account'].id, session['account_id']
  26.   end
  27.  
  28. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top