ue.should_receive(:save).and_return(:false)
> # you should define the "should receive" before calling "post :create"
>
> post :create, { :issue => {:title => 'some
> title', :description => ''}}
> end
Hello, I am learning rspec/rspec-rails and ruby on rails.
Controller:
class IssuesController < ApplicationController
def index
end
def new
@issue = Issue.new
end
def create
@issue = Issue.new
It seems your Phase.percentage_complete is not working as you expect.
It clearly returns 100 when you are specting 83. The test clearly said
that.
¿What is the implementation of your percentage_complete method?
2008/7/1 Matt Darby <[EMAIL PROTECTED]>:
> Hrm.
>
> I have a spec for a model 'Phase'.
nt
> config.action_controller.allow_forgery_protection= false
>
>
> -Mike
>
>
> On Sat, Mar 15, 2008 at 2:26 PM, Scott Taylor
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Mar 16, 2008, at 2:41 PM, Camilo Torres wrote:
> >
> >
I am starting to BDD. When specing the controller I want to test for
object creation:
it "deberia crear una nueva persona en post create" do
Usuario.should_receive(:create).with({:nombre => "camilo", :clave
=> "secreta", :tipo => "administrador"}).and_return(@usuario)
post 'create', {:u