Re: [rspec-users] help Rails params[]

2013-08-02 Thread Adam Sroka
Did you try it? What happened? On Mon, Jul 22, 2013 at 2:56 AM, oliver oliverjesus2...@yahoo.com wrote: Is it possible in rails to have params like this or syntax of params like this? % @users.each do |user| % % @menus.each do |menu| % *params[user.name menu.id]* % end % %

Re: [rspec-users] expecting one of two conditions

2013-03-09 Thread Adam Sroka
It depends on what you really mean: 1) If you care that it is either OneError or OtherError, then these are two separate scenarios and should be written as such. 2) If you don't care which one it is, then you probably just be less specific. Is there a common message they respond to that you

Re: [rspec-users] Speeding up RSpec Tests

2013-02-13 Thread Adam Sroka
Why would you need to generate models with passwords for every spec? Why would you need to generate a password for *any* spec that wasn't specifically about authentication? It seems like hacking BCrypt is a way to avoid the design problem rather than just taking it on. On Wed, Feb 13, 2013 at

Re: [rspec-users] what would be the best way to stub out an XHR request's response?

2012-09-26 Thread Adam Sroka
I would just wrap the method that makes the ajax call and spec it from Jasmine. Then you can just stub the wrapper to return the data you want and expect the right thing to happen in the callback method (or however the data gets stored/displayed.) On Wed, Sep 26, 2012 at 10:26 AM, Ervin Weber

Re: [rspec-users] A recently observed anti pattern: commented out tests

2012-07-24 Thread Adam Sroka
info. -james On Mon, Jul 23, 2012 at 10:58 PM, Adam Sroka adam.sr...@gmail.com wrote: I haven't posted in a while, but I want to say that as someone who spends a significant portion of his time teaching (T/B)DD I am totally in love with pending specs. There are analogous concepts

Re: [rspec-users] A recently observed anti pattern: commented out tests

2012-07-23 Thread Adam Sroka
I haven't posted in a while, but I want to say that as someone who spends a significant portion of his time teaching (T/B)DD I am totally in love with pending specs. There are analogous concepts in nearly every xUnit/xSpec, but pending is by far the best. Kudos. On Jul 23, 2012 9:57 PM, David

Re: [rspec-users] Override tests (of a core rails app from a plugin)

2011-10-02 Thread Adam Sroka
On Sun, Oct 2, 2011 at 11:57 AM, Felix Schäfer f.schae...@finn.de wrote: Am 01.10.2011 um 22:17 schrieb Justin Ko: Specs do not over-ride each other That's what I was able to gather so far, unfortunately. , so I can't think of an easy to do what you're trying to do. With that said, I

[rspec-users] hey rspec-users

2011-05-31 Thread adam . sroka
Hey rspec-users I just wanted to share this opportunity with you, I've been making 200-300 dollars a day and I started only a week ago. Check out this news article and it will show you how to get started, it's definitely easy enough for you :)!

Re: [rspec-users] Is it possible to run rspec continuously?

2011-03-22 Thread Adam Sroka
Check out this book: http://www.pragprog.com/titles/rcctr/continuous-testing-with-ruby It is about to be published and is available as a beta PDF. They cover several tools and both why and how to use them. On Mar 22, 2011 2:57 PM, Benyi Wang bewang.t...@gmail.com wrote: When I run rspec in

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

2010-05-21 Thread Adam Sroka
I have had similar experiences. If I submit the form and assert stuff about the next page that comes up then I end up with a big slow integration test like the kind you talk about as bad. It seems to me like this is an overly coupled design, but I don't know a way around it if I intend to use HTML

Re: [rspec-users] more rspec questions

2010-04-29 Thread Adam Sroka
With only a cursory look that looks good to me. If I have some time later I will look more carefully and maybe suggest some refactorings, but you look to be on the right track. The important thing is just to practice and continually improve. Best, Adam On Wed, Apr 28, 2010 at 11:37 PM, Patrick

Re: [rspec-users] more rspec questions

2010-04-28 Thread Adam Sroka
On Tue, Apr 27, 2010 at 4:56 PM, Patrick J. Collins patr...@collinatorstudios.com wrote: If something in the code you are testing depends on the return value of a method then you would use a stub. e.g.: Right, but what I am asking is---  if all of my slave methods are relying on stored card

Re: [rspec-users] more rspec questions

2010-04-27 Thread Adam Sroka
On Tue, Apr 27, 2010 at 2:20 PM, Patrick J. Collins patr...@collinatorstudios.com wrote: Hi everyone, I still am on my quest to understand Rspec, and I have a few new questions... If I have a complex method which calls other methods, say something like: - class Foo  def

Re: [rspec-users] more rspec questions

2010-04-27 Thread Adam Sroka
On Tue, Apr 27, 2010 at 2:51 PM, Patrick J. Collins patr...@collinatorstudios.com wrote: Hi, What if they didn't? Is there a different way you could design this so that the interesting bits (The small methods) didn't depend so much on the other bits around them? Well this is for importing

Re: [rspec-users] more rspec questions

2010-04-27 Thread Adam Sroka
If something in the code you are testing depends on the return value of a method then you would use a stub. e.g.: foo = mock(Foo) foo.stub!(:slave_method).and_return(foo) However, in some cases what matters is not what the method returns but the fact that slave_method gets called. i.e.:

Re: [rspec-users] When to use Factories, Mock Models, Mocks Stubs

2010-02-02 Thread Adam Sroka
On Tue, Feb 2, 2010 at 9:53 PM, Andrei Erdoss erd...@gmail.com wrote: Hello Frank, From my understanding these are the roles of should_receive and stub. should_receive checks to make sure that a method or a property is called. To this you can specify the arguments that it gets called