Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Nope, just an alias. On Sat, Jan 19, 2013 at 12:48 AM, fuzzy wrote: > Thanks Mirri for you post ... I had a look at the link ... are they > saying that 'specify' has now been superceded by 'it'? > > > On Jan 18, 10:17 am, Mirri Kim wrote: > > Hi, >

Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Hi, `specify` is actually just the same as `it`. It's just there because sometimes it reads better. See here: https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/example_group.rb#L82 - Mirri On Fri, Jan 18, 2013 at 5:22 PM, wrote: > Hey fuzzy, > > I think the first thing that is may

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Mirri Kim
Hi Soichi, You can temporarily do `if @plan.save!` to raise an error instead of just having it return false and not give you any feedback. Doing this is okay because you should not bother testing your validations as far as the controller is concerned (you do that on your model). In any case, try t

Re: [Rails] RSpec: controller POST create

2012-11-12 Thread Mirri Kim
On your controller, use `create!` to see what is preventing the save. On Mon, Nov 12, 2012 at 5:19 PM, Soichi Ishida wrote: > Rails 3.1.3 > rspec-rails (2.11.4) > rspec 2.11.1 > > I am new to rspec. I don't quite understand tests for POST create part. > > I have generated scaffold, and simultan

Re: [Rails] Set a query filter

2012-09-21 Thread Mirri Kim
I won't generally go with that approach: - Skill.all can get big - You're doing 2 queries by default plus the array subtraction It's better to just use a scope or a class method on Skill or some service class in my opinion but for brevity nothing tops that. The results would (should) be cached an

Re: [Rails] [RSpec Testing] Methods take two arguments

2012-09-15 Thread Mirri Kim
weird, it's like saying a = 1; a.should == 1. On Sun, Sep 16, 2012 at 1:57 AM, Mirri Kim wrote: > Hi there, try: > > PdfHelper.should_recieve(:create_pdf).with(user, file) > > > On Sun, Sep 16, 2012 at 1:01 AM, Adnan wrote: > >> Hello, >> >> Here is

Re: [Rails] [RSpec Testing] Methods take two arguments

2012-09-15 Thread Mirri Kim
Hi there, try: PdfHelper.should_recieve(:create_pdf).with(user, file) On Sun, Sep 16, 2012 at 1:01 AM, Adnan wrote: > Hello, > > Here is my *pdf_helper.rb* => http://pastebin.com/QU1kTKXk. I want to > test, if self.create method can take more than two arguments. But, when I > try to run my test

Re: [Rails] Re: Version changes listing

2012-07-03 Thread Mirri Kim
Hi, there are links to the release notes at the bottom of that page (e.g., http://guides.rubyonrails.org/3_2_release_notes.html). On Fri, Jun 29, 2012 at 10:32 AM, RVince wrote: > Carlos, I keep going over this url, but I dont see any reference to > version changes here. What am I missing? Thank

Re: [Rails] Re: why use rescue nil?

2012-06-20 Thread Mirri Kim
Just a reminder: it's just specific with the find(). find_by_* will return nil unless you add a ! (e,g,, find_by_name!()) then it also returns the exception On Wed, Jun 20, 2012 at 8:55 AM, John Merlino wrote: > ok I thought it would return nil > > thanks for response > > On Jun 19, 8:33 pm, Fer