[rspec-users] Rails 3 , RSpec 2.0.0.beta.11

juange juange88 at gmail.com
Fri Jun 11 18:54:11 EDT 2010


Hi,

I was doing some testing to mi controller and a error raise, and it's
driving me crazy. This are the lines that I wanna test:

    @cloning_vector = CloningVector.new(params[:cloning_vector])
    @cloning_vector.sequence = Sequence.new(params[:sequence])

What I'm trying to do is following:

      @cloning_vector = mock_model(CloningVector)
      @sequence = mock_model(Sequence)

      CloningVector.should_receive(:new).with("name" => "New
cloning_vector", "cloning_vector_type" =>
1).and_return(@cloning_vector)
      @cloning_vector.sequence.should_receive(:new).with("content" =>
"New Content").and_return(@sequence)

What am I doing wrong?..... Thanks for your help


More information about the rspec-users mailing list