Created
January 12, 2010 21:10
-
-
Save ktec/275616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class AccountControllerTest < ActionController::TestCase | |
context 'GET to edit for existing account' do | |
setup do | |
@account = Factory(:account) | |
Account.stubs(:find).returns(@account) | |
get :edit, :id => @account.to_param | |
end | |
should 'find account' do | |
assert @account.valid?, @account.errors | |
end | |
should_render_template :edit | |
should_respond_with :success | |
end | |
context 'PUT to update for existing account' do | |
setup do | |
@account = Factory(:account) | |
put :update, :id => @account.to_param, | |
:account => Factory.attributes_for(:account) | |
end | |
should_set_the_flash_to /updated/i | |
should_redirect_to('accounts edit') { edit_account_path } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment