-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
With the controller:
class TransactionImportsController < ApplicationController
def create
redirect_to transaction_imports_url
end
end
and the request spec:
describe "TransactionImports" do
it "should fail" do
get '/transaction_imports/new'
post '/transaction_imports' # rendered template is still "new" here!
response.should redirect_to(transaction_imports_url)
response.should render_template('new')
end
end
The spec is passing (it checks logically opposite results).
The reason is that there are 2 requests (get and post). Obviously the result of post
preserves the result of the previous get
.
I might be missing something, but I suppose it should not be the case in integration test - each response/request should not be in any way related to the others (except the session and cookies).
I also might be doing something wrong of course :)
Using rspec 2.0.0.
Metadata
Metadata
Assignees
Labels
No labels