Skip to content

should render and should redirect_to are both passing #241

@dnagir

Description

@dnagir

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions