Re: [rspec-users] How can I execute rspec directly from ruby code?

2011-05-02 Thread David Chelimsky
On Apr 28, 2011, at 1:33 PM, Pablo Cantero wrote: > Hi > > Can I execute rspec directly from ruby code? I would like to do it > similar I can do using Test::Unit > > Test::Unit::UI::Console::TestRunner.run(MySuite.new(MyTestCase)) > > I was looking on internet how to execute it, but I wasn't f

Re: [rspec-users] rspec-rails not making routes accessible since I *think* 2.2.1 (Currently using 2.5)

2011-05-02 Thread David Chelimsky
On May 1, 2011, at 8:29 PM, JDeville wrote: > I'm trying to use: > get path_to_route What kind of spec? Controller? Request? View? > which had been working previously. Was this an intentional change? Nope. > Can I get this behavior back, Assuming it's actually missing, yes, but we've got nam

Re: [rspec-users] Simple Association Redirect on delete

2011-05-02 Thread Canuk
Here is how I ended up getting my test to pass: instead of using a stub/mock, I used a Factory, since that more closely aligned with the actual functionality anyway. On Feb 28, 7:14 pm, Charley wrote: > I am not sure if I am properly using the respond to call as you > suggested. Here is what I tr

[rspec-users] rspec-rails not making routes accessible since I *think* 2.2.1 (Currently using 2.5)

2011-05-02 Thread JDeville
I'm trying to use: get path_to_route which had been working previously. Was this an intentional change? Can I get this behavior back, or was there a reason it was removed. Thanks all. ___ rspec-users mailing list rspec-users@rubyforge.org http://ruby

Re: [rspec-users] Simple Association Redirect on delete

2011-05-02 Thread Canuk
I'm having the (seemingly) exact same issue. Were you able to figure this out? I'm relatively new to rspec and my controller code works, but the test is failing. It seems like it is not able to retrieve a method from the stub. On Feb 28, 7:14 pm, Charley wrote: > I am not sure if I am properly

[rspec-users] How can I execute rspec directly from ruby code?

2011-05-02 Thread Pablo Cantero
Hi Can I execute rspec directly from ruby code? I would like to do it similar I can do using Test::Unit Test::Unit::UI::Console::TestRunner.run(MySuite.new(MyTestCase)) I was looking on internet how to execute it, but I wasn't found it Is it possible? Best, Pablo Cantero

Re: [rspec-users] Problems with integration test

2011-05-02 Thread Pablo L. de Miranda
Chris, Thank you man, I replaced all my symbol for field name references, and worked fine. Pablo ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Problems with integration test

2011-05-02 Thread Chris Mear
On 2 May 2011, at 18:04, "Pablo L. de Miranda" wrote: > Hi Chris, > > Thank your for your explanation, but I have a doubt about this. I'm > printing the method test bellow: > it "should create a new account" do >lambda do > visit new_subdomain_path > response.shoul

Re: [rspec-users] Stubbing corner case

2011-05-02 Thread Doug McInnes
On Apr 25, 2011, at 10:51 AM, Doug McInnes wrote: > Sure! > Here's the Gist: > > https://gist.github.com/940868 > > It's works in Rspec 2.5.1, but not in Rspec 1.3.2 > > Doug > > > On Apr 23, 2011, at 3:00 PM, David Chelimsky wrote: > >> On Apr 22, 2011, at 4:58 PM, Doug McInnes wrote: >>

Re: [rspec-users] fields_for view spec

2011-05-02 Thread Chris Mear
On 2 May 2011 00:58, Matt S. wrote: > 1) Is there a way to make this trivial example spec to pass? (If so, > how?) > > 2) Advice: I would like to write more view specs, especially on views > for models with more complex relationships. Is it worth it? > > (The reason I ask this somewhat rhetorical

Re: [rspec-users] Problems with integration test

2011-05-02 Thread Pablo L. de Miranda
Hi Chris, Thank your for your explanation, but I have a doubt about this. I'm printing the method test bellow: it "should create a new account" do lambda do visit new_subdomain_path response.should render_template('subdomains/new') fill_in :nome, :with =

Re: [rspec-users] Problems with integration test

2011-05-02 Thread Chris Mear
On 2 May 2011 13:53, Pablo L. de Miranda wrote: > Hi guys, > > I'm writing a integration test and i'm still have problems with a form field. > The RSpec continues to show me a message bellow: > > Failure/Error: fill_in :password_confirmation, :with => > @attr[:password_confirmation] >     Webrat::

[rspec-users] Problems with integration test

2011-05-02 Thread Pablo L. de Miranda
Hi guys, I'm writing a integration test and i'm still have problems with a form field. The RSpec continues to show me a message bellow: Failure/Error: fill_in :password_confirmation, :with => @attr[:password_confirmation] Webrat::NotFoundError: Could not find field: :password_confirma

Re: [rspec-users] rspec contribution at railsconf?

2011-05-02 Thread David Chelimsky
On Apr 28, 2011, at 8:41 PM, Jed Schneider wrote: > Hi, > > I was curious if there was any interest in organizing a 'bugmash', if you > will, of any outstanding rspec features or issues during railsconf. (maybe > there is something planned that i missed?) > > I'm not sure how much there is to

Re: [rspec-users] HTTP Status 406 When Testing :json

2011-05-02 Thread Sidu Ponnappa
By the way, asserting on the response code will only help ensure that you don't get green specs even though you're request fails with a 406 (or something similar). You're getting a 406 because whatever the Accepts header is on that request ('application/json' I'd presume) does not have a responds_t

Re: [rspec-users] HTTP Status 406 When Testing :json

2011-05-02 Thread Sidu Ponnappa
Hi, When testing Rails APIs, always assert on response codes and where relevant, the Location, Content-Type and other headers. We wound up doing this on every single project and so extracted it into a gem that you might find useful: https://github.com/c42/rspec-http Best, Sidu. http://c42.in http

[rspec-users] HTTP Status 406 When Testing :json

2011-05-02 Thread Ants Pants
Hello all, My first question, in my controllers, do I need to test respond_to is returning the correct data for its mime-type? In my controller spec I have it "creates a list of available types for that category" do xhr :get, :index_available, :category_id => 1, :format => :json assi