[Rails] Re: Rspec2+Factory girl, how to test a change?
How does your factory declaration look like?
On Feb 2, 3:55 am, Kleber Shimabuku <klebershimab...@gmail.com> wrote:
> Hi, I'm new on tests but trying to test the following method, but it
> gives me an error message about "nil is not a symbol".
>
> # job.rb
> ==
> def publish(url)
> update_attributes(:available => true, :locked => false)
> tweet(url)
> end
>
> # job_spec.rb
> ===
> it "should publish a job" do
> @job = Factory(:job, :available => false)
> lambda { @job.publish }.should
> change(@job.available).from(false).to(true)
> end
>
> # error
> ==
> 1) Job Job publish should publish a job
> Failure/Error: lambda { @job.publish }.should
> change(@job.available).from(false).to(true)
> nil is not a symbol
> # ./spec/models/job_spec.rb:128:in `block (3 levels) in <top
> (required)>'
>
> Finished in 1.12 seconds
> 47 examples, 1 failure, 4 pending
>
> any idea?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home