Re: [rspec-users] Test execution time filtering

2011-08-17 Thread Stefan Kanev
On Wed, Aug 10, 2011 at 2:23 AM, Mike Jr wrote: > But a sophisticated test will make decisions in mid test. If a > certain test condition occurs, set a singleton hash and then have > later tests condition their processing on that hash. In my tests, > these if statements are within the it blocks

Re: [rspec-users] Test execution time filtering

2011-08-17 Thread Stefan Kanev
> > RSpec is built around the premise that each example is run in its own > environment, and that one should not depend on the outcome of another. This > is not unique to RSpec, btw. It's how all of the unit testing frameworks of > which I am aware work. > I know I'm going off-topic, but TestNG su

Re: [rspec-users] ControllerExampleGroup.bypass_rescue

2011-08-11 Thread Stefan Kanev
I agree with Lenny. I can give an example. Lets say that parts of the application are restricted. Whenever they are accessed by an unauthorized user, they trigger UnauthorizedAccessError. Depending on the role the user has in the system, different actions should be performed, e.g. unauthenticated

Re: [rspec-users] Overriding Kernel#inspect just for tests

2011-04-08 Thread Stefan Kanev
Ah, that's clever. Thanks. On Fri, Apr 8, 2011 at 3:43 PM, David Chelimsky wrote: > On Fri, Apr 8, 2011 at 1:52 AM, Stefan Kanev > wrote: > > Hi all. > > Occasionally, I write specs that verify the order in which some > ActiveRecord > > objects are returned. Fo

[rspec-users] Overriding Kernel#inspect just for tests

2011-04-07 Thread Stefan Kanev
Hi all. Occasionally, I write specs that verify the order in which some ActiveRecord objects are returned. For example, in a toy project I do: Reply.stub :per_page => 2 topic.replies_on_page(1).should == [second, first] The spec out quickly get unwieldy when it fails: 1) Topic paginates its r

Re: [rspec-users] Good practices on spec'ing views?

2010-05-21 Thread Stefan Kanev
Thank you for your answers! > In The Rspec Book, section 24.6 (chapter 24), "When I write view specs" offers some tips for determining when to write view specs. Have you read this section? I though I did, but I revisited it and I learned some new things. Thanks! I did some thinking on my own a

[rspec-users] Good practices on spec'ing views?

2010-04-30 Thread Stefan Kanev
Hey guys. I've been doing RSpec for more than a year by now, yet I cannot help but feel that I've never got a single view spec right. I can see that I have very few view specs and that my views tend be a lot messier than everything else. I've read the chapter in the RSpec book about spec'ing views

[rspec-users] Disabling database access in controller specs

2010-03-03 Thread Stefan Kanev
It took a while, but now I an totally convinced that controller specs should not access the database and stub as much as possible. I'm committed to that style of writing, yet from time to time I incidentally allow it to happen. Is there a way to err on the safe side and have RSpec throw an error e

[rspec-users] spec'ing controllers

2009-12-16 Thread Stefan Kanev
Hey guys. I switched completely to RSpec and Cucumber this spring and I am really happy with. While I think I've gotten quite good with it, I'm not sure I understand the value of spec'ing controllers (in Rails). I would appreciate if you can give me some suggestions. Let me elaborate: The RSpec b

Re: [rspec-users] Where to put macros

2009-06-22 Thread Stefan Kanev
On Mon, Jun 22, 2009 at 7:37 PM, David Chelimsky wrote: > On Mon, Jun 22, 2009 at 11:28 AM, Andrew Premdas > wrote:What would folks think if that was included in the generated > spec_helper in spec-rails? > I, while not a regular patron in this mailing list, +1 this too. It would be very nice if