Re: [rspec-users] mocking and stub comprehension

2008-11-19 Thread Sahyoun
Thanks Zach, Your suggestion has put me back on track. Cheers, Omar On 17 Nov 2008, at 00:13, Zach Dennis wrote: On Sun, Nov 16, 2008 at 5:53 PM, Sahyoun <[EMAIL PROTECTED]> wrote: Hello, I'm specing a controller, but having trouble getting my head around what I'

[rspec-users] mocking and stub comprehension

2008-11-16 Thread Sahyoun
Hello, I'm specing a controller, but having trouble getting my head around what I've created. I'm specing a products controller for an admin user. Two before filters check the user is logged in and authorized. A logged-in user only has admin privileges within her own subdomain. So, sarah,

[rspec-users] spec for model_id should eql

2007-12-03 Thread Sahyoun
Hello, I'm confused why the spec described below is failing. Other simple comparison specs are passing fine for the same model. The code is working accordingly when I test it through the console, I'm just having difficulty getting this spec to work. Any pointers would be appreciated. Failure mess

[rspec-users] mock feed

2007-12-01 Thread Sahyoun
Hello generous coders, I'm having difficulty getting a couple of tests to pass. I have an address model which takes an address and with a callback on save and update passes the address to google's geocoding service. The returned XML is parsed and saved to the address object: protected def g

Re: [rspec-users] describe AddressesController, "handling GET /addresses" do

2007-11-22 Thread Sahyoun
r On 21/11/2007, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On Nov 21, 2007 1:35 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On Nov 21, 2007 1:15 AM, Sahyoun <[EMAIL PROTECTED]> wrote: > > > Thanks. That helped. I now have: > > > > > > be

Re: [rspec-users] describe AddressesController, "handling GET /addresses" do

2007-11-21 Thread Sahyoun
ddresses).and_return(@addresses) would be sufficient for the above to pass. My understanding of mocking and stubbing is sketchy at the moment. Any explanation on how to get this to pass would be appreciated. Many thanks, Omar On 21/11/2007, Jarkko Laine <[EMAIL PROTECTED]> wrote: > > > On

[rspec-users] describe AddressesController, "handling GET /addresses" do

2007-11-20 Thread Sahyoun
Hello, I'm working with scaffold generated controller test code for handling GET requests. Address is the model being tested. Address belongs_to Company, Company has_many addresses. In my addresses_controller I have: before_filter :get_company def index @addresses = @company.addresses.find(: