Permalink
Browse files

spork/autospec demo

  • Loading branch information...
dchelimsky committed Oct 13, 2009
1 parent ec2a407 commit dd22f07d3e72da3ce5a56e6ab688661baa38f8cc
@@ -45,7 +45,7 @@ def create
respond_to do |format|
if @account.save
flash[:notice] = 'Account was successfully created.'
- format.html { redirect_to(@account) }
+ format.html { redirect_to(accounts_url) }
format.xml { render :xml => @account, :status => :created, :location => @account }
else
format.html { render :action => "new" }
@@ -24,9 +24,8 @@ def mock_account(stubs={})
describe "GET new" do
it "assigns a new account as @account" do
- Account.stub(:new).and_return(mock_account)
get :new
- assigns[:account].should equal(mock_account)
+ assigns[:account].should be_a_new_record
end
end
@@ -50,7 +49,7 @@ def mock_account(stubs={})
it "redirects to the created account" do
Account.stub(:new).and_return(mock_account(:save => true))
post :create, :account => {}
- response.should redirect_to(account_url(mock_account))
+ response.should redirect_to(accounts_url)
end
end

0 comments on commit dd22f07

Please sign in to comment.