[rspec-devel] [ rspec-Feature Requests-14304 ] Specify the controller request in the description options

noreply at rubyforge.org noreply at rubyforge.org
Sun Sep 30 21:16:29 EDT 2007


Feature Requests item #14304, was opened at 2007-09-28 11:39
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=14304&group_id=797

Category: rails plugin
Group: None
Status: Open
Priority: 3
Submitted By: Jonathan Leighton (jonleighton)
Assigned to: Nobody (None)
Summary: Specify the controller request in the description options

Initial Comment:
I was experimenting with metaprogramming some of my examples, in order to keep my specs DRY, and I needed some way to programmatically specify what the request being tested was. I came up with this:

describe ArticlesController, :request => { :get => :show, :id => 53 } do
  it "should find the article" do
    Article.expects(:find).with(53)
    send_request
  end
end

Here is my code: http://pastie.caboo.se/101764

I would be willing to make this into a patch if it sounds like a good idea?

----------------------------------------------------------------------

Comment By: Mike Mangino (mmangino)
Date: 2007-09-30 20:16

Message:
I don't care for this at all. If you want this behavior, you could easily define the send_request method yourself. It just seems like a really obscure syntax. I'd rather the action performed by send_request be made more explicit.

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-09-30 10:05

Message:
It sounds like a good idea, but I'd like to get more feedback first.

How about blogging it or releasing it as a plugin so people can get some experience with it. If the feedback is generally positive I'd be open to adding it.

The only reason I'm not jumping on it is that I've been feeling as though RSpec has become too bloated as it is, and I'm hesitant to add any new features without careful consideration.

It does sound like a good idea, and I'll be exploring it myself on my own projects.

Cheers,
David

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=14304&group_id=797


More information about the rspec-devel mailing list