Re: [rspec-users] A bit confused with the use of assign() to test views

2011-08-03 Thread Gordon Yeong
Hello David Thanks for that. Doesn't assign have 2 arguments with the first being the variable to be assigned to and the second being the contents? On Aug 3, 2011 7:01 PM, "ct9a" wrote: > also, i have just read a little more in the rspec book. > > here's an extract: > > - extract star

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Gordon Yeong
e' => 'Brake pads'} flash[:notice].should eq('Part was successfully updated.') end end Spec extract ends - Thank you for your help, Justin! Gordon Yeong :) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Gordon Yeong
> > > Do you have a before filter somewhere that is preventing the > :update_attributes message from being received? > > I have checked my application's controllers (app/controllers/application_controller.rb and app/controllers/parts_controller.rb) and controller spec (spec/controllers/parts_cont

Re: [rspec-users] assert_select - to do negative tests - need help with syntax please :)

2011-10-12 Thread Gordon Yeong
> > What _will_ work is this: > > assert_select "input#brand_created_by", false > > Hmmm. Sadly it does not work :( See below: extract start - Failure/Error: assert_select "input#brand_created_by", false, :name => "brand[created_by]" ArgumentErr

Re: [rspec-users] assert_select - to do negative tests - need help with syntax please :)

2011-10-13 Thread Gordon Yeong
> > > This ^^ does include :name => "". > > What happens when you just run > > assert_select "input#brand_created_by", false > > this runs successfully but how do I do it with the :name? :( I just want to be complete and explicit :) ___ rspec-users

Re: [rspec-users] Helper methods can't be called within before hooks. Help, please.

2011-10-14 Thread Gordon Yeong
It's just that I did not find my reply surface after 20 mins and was wondering if it was lost. Sorry about that, everyone :( my apologies. On 14 October 2011 16:01, Justin Ko wrote: > > On Oct 13, 2011, at 8:59 PM, Gordon wrote: > > > > > > > Hi, there, > > > > > > I believe I have some proble

Re: [rspec-users] What does :count actually mean in assert_select?

2011-11-18 Thread Gordon Yeong
I think i answered my own question. :count refers to the number of fixture objects. The reason why :count => 2 was passing for views index specs is because 2 objects are being mocked and they are identical. Hence, there are 2 stock tests: 1) asserts that there are 2 elements which have the

Re: [rspec-users] 'new' method works as expected but rspec does not recognise flash contents or redirection

2012-03-26 Thread Gordon Yeong
Guys, Not sure why but I deleted my Gemfile.lock file. Found that it's due to a stale Gemfile.lock file which is still using rspec-core 2.8.0 when in fact I just performed and update yesterday night on rspec (hence I've got rspec-core 2.9.0). Ran "rspec parts_controller.spec.rb" again and all