Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'test_helper'
- class AccountsControllerTest < ActionController::TestCase
- def setup
- @valid_params = {:username => "foo",
- :password => "secret",
- :password_confirmation => "secret",
- :email => "foo@example.com"}
- end
- def test_new
- get :new
- assert_template 'new'
- end
- def test_create_invalid
- post :create, :account => {}
- assert_template 'new'
- end
- def test_create_valid
- post :create, :account => @valid_params
- assert_redirected_to root_url
- assert_equal assigns['account'].id, session['account_id']
- end
- end
Add Comment
Please, Sign In to add comment