Re: [rspec-users] Data-wise context combination for controller speccing

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 1:18 PM, Costa Shapiro wrote: > Hello, > > I've been thinking of how to express my idea in code, but since I've never > been involved in RSpec development, I'd better have some feedback here first. > The feature suggestion below applies to any controller-like code under spec,

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 2:25 PM, Daniel Salmeron Amselem wrote: > On Jul 17, 9:41 am, David Chelimsky wrote: >> On Jul 17, 2010, at 8:09 AM, David Chelimsky wrote: >>> On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: >> Today I've been writing some tests for a new rails 3 app, but af

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread Daniel Salmeron Amselem
Thanks David, this was driving me crazy. In my opinion, I think will be a great idea to add a new matcher to rspec-rails to do this kind of comparison better than overriding == , and have total control of what you want to test in each case. Anyways, thanks for helping me on this. On Jul 17, 9:41 a

[rspec-users] Data-wise context combination for controller speccing

2010-07-17 Thread Costa Shapiro
Hello, I've been thinking of how to express my idea in code, but since I've never been involved in RSpec development, I'd better have some feedback here first. The feature suggestion below applies to any controller-like code under spec, i.e. a stateless module producing output or just altering its

Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Ashley Moran
On 17 Jul 2010, at 5:43 PM, doug livesey wrote: > Please tell me they're doing *some*thing, as I'm using S3 storage, which > would really slow my tests down if I just did nothing. > I'm starting to think of all sorts of horrible solutions, like making the > storage strategy dependent on the env

Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Ashley Moran
On 17 Jul 2010, at 5:58 PM, Steve Klabnik wrote: > You don't need to test Paperclip's ability to put files to S3 It depends on your confidence in Paperclip (s/Paperclip/X random library) and the severity of problem it could cause if it doesn't work. To me, at least, it's more a risk/value ju

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread Ashley Moran
On 17 Jul 2010, at 4:37 PM, doug livesey wrote: > At the minute I'm chaining a load of should_receive calls on mock relation > objects I've found this can cause pain in so many ways: * Your tests end up coupled to the database structure (as that's how most associations are inferred) * You're a

Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread doug livesey
I was wary of taking an approach like that, as it feels a little like test code bleeding into production code, but the sheer number of problems I'm having trying another way tells me that I'm very inadvisedly swimming against the stream, here. So I think I'll rethink my strategy & try something mor

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread Wincent Colaiuta
El 17/07/2010, a las 17:37, doug livesey escribió: > Hi -- how are people speccing Rails 3 ActiveRecord queries? > At the minute I'm chaining a load of should_receive calls on mock relation > objects, but can't help thinking that there must be a more elegant way of > going about it. > Is there a b

Re: [rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread Steve Klabnik
One of the things that you learn after testing for a while is "what to test." You don't need to test Paperclip's ability to put files to S3; that's what Paperclip's internal tests are for. So what I do is this: http://gist.github.com/479647 When I'm developing locally or testing, I just write fil

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread doug livesey
Interesting. I'll give that a bash, too. I must admit, I tend to use the first approach, but the second seems a little more true to the spirit of testing. I can imagine that it might get rather involved when setting up the database for even half-way complex queries, though. I'll see how I get on wi

[rspec-users] How are people speccing and cuke-ing Paperclip (with S3)?

2010-07-17 Thread doug livesey
Hi -- I'm running into all sorts of difficulties trying to use paperclip with cucumber and rspec. Basically, I'm stubbing out paperclip calls with WebMock (I've adapted the shoulda macro that uses FakeWeb to do this). But every time I get things running smoothly, something else pops up to screw t

Re: [rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 10:37 AM, doug livesey wrote: > Hi -- how are people speccing Rails 3 ActiveRecord queries? > At the minute I'm chaining a load of should_receive calls on mock relation > objects, but can't help thinking that there must be a more elegant way of > going about it. > Is there a

[rspec-users] How are people speccing Rails 3 ActiveRecord queries?

2010-07-17 Thread doug livesey
Hi -- how are people speccing Rails 3 ActiveRecord queries? At the minute I'm chaining a load of should_receive calls on mock relation objects, but can't help thinking that there must be a more elegant way of going about it. Is there a best practice for this, yet? Cheers, Doug. _

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 8:09 AM, David Chelimsky wrote: > > On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: > >> Today I've been writing some tests for a new rails 3 app, but after >> reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, >> I still can't understand why

Re: [rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread David Chelimsky
On Jul 17, 2010, at 3:29 AM, Daniel Salmeron Amselem wrote: > Today I've been writing some tests for a new rails 3 app, but after > reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, > I still can't understand why the test doesn't work. My setup is: > > rvm 0.1.41 > ruby 1.

[rspec-users] assigns and should eql don't work as expected

2010-07-17 Thread Daniel Salmeron Amselem
Today I've been writing some tests for a new rails 3 app, but after reading the doc from http://rdoc.info/projects/rspec/rspec-expectations, I still can't understand why the test doesn't work. My setup is: rvm 0.1.41 ruby 1.9.2dev (2010-07-11 revision 28618) [x86_64-darwin10.4.0] -> ruby 1.9.2-rc2