[rspec-users] spec for view with Searchlogic

2009-03-25 Thread Andrea Jahn
Hi, I'm using the Searchlogic plugin. Since I have added the search form in the index template, the view spec doesn't work anymore. Controller - def index @search = PlPlanning.new_search(params[:search]) @search.order_by = :id @pl_plannings, @count = @search.all, @search.count

[rspec-users] [Cucumber] ANN: Cucumber with pure Java

2009-03-25 Thread aslak hellesoy
Big news for all Java programmers out there. Now you can use Cucumber with pure Java! That's right, you don't have to write a single line of Ruby! (1) All of your step definitions can be written as annotated methods in POJOs (Plain Old Java Objects). To get a taste of what this looks like, check

Re: [rspec-users] [Cucumber] ANN: Cucumber with pure Java

2009-03-25 Thread Ben Mabey
On Mar 25, 2009, at 9:08 AM, aslak hellesoy wrote: Big news for all Java programmers out there. Now you can use Cucumber with pure Java! That's right, you don't have to write a single line of Ruby! (1) All of your step definitions can be written as annotated methods in POJOs (Plain Old Java

Re: [rspec-users] Spec::Rails, "model.should have(1).error_on(:attribute)"

2009-03-25 Thread Phor Gruber
I added: - validates_presence_of :attribute To my model. The test now passes. yay!! Thanks David. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [Cucumber 0.2] Failure to use should

2009-03-25 Thread Yi
Just did a little bit exploration. Found out http://github.com/carlosbrando/remarkable/tree/master plugin I use actually cause the problem. This plugin also broke spec:server:start rake task as well. :-( On Thu, Mar 19, 2009 at 5:03 PM, Yi wrote: > I thought be_something is actually handled by r

[rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Tadatoshi Takahashi
Hi, I started to use RSpec and RSpec-rails 1.2.0 last week when I upgraded to Ruby on Rails 2.3.2. At that time, "ruby script/generate rspec" hang but autospec and "rake spec" were successful. Yesterday, I updated to RSpec and RSpec-rails 1.2.2. This time, "ruby script/generate rspec" was success

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Tadatoshi Takahashi
Tadatoshi Takahashi wrote: > Hi, > > I started to use RSpec and RSpec-rails 1.2.0 last week when I upgraded > to > Ruby on Rails 2.3.2. > At that time, "ruby script/generate rspec" hang but autospec and "rake > spec" > were successful. > > Yesterday, I updated to RSpec and RSpec-rails 1.2.2. >

Re: [rspec-users] [Cucumber] ANN: Cucumber with pure Java

2009-03-25 Thread Aslak Hellesøy
Den 25. mars. 2009 kl. 18.18 skrev Ben Mabey : On Mar 25, 2009, at 9:08 AM, aslak hellesoy wrote: Big news for all Java programmers out there. Now you can use Cucumber with pure Java! That's right, you don't have to write a single line of Ruby! (1) All of your step definitions can be writt

[rspec-users] How to spec a around_filter

2009-03-25 Thread Alex
Hi all, any of you guys had success specking out a around_filter? I tried a few things like controller.should_receive (:around_filter_method), controller.stub!(:around_filter_method) but without success. In fact, the method is always executed even though I stubed it. What I find strange is that I a

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Stephen Eley
On Wed, Mar 25, 2009 at 3:29 PM, Tadatoshi Takahashi wrote: > > P.S. > It seems that autospec is run against test database and that "rake spec" > is run against development database. > How can I resolve this problem? The first thing I'd check would be whether you have RAILS_ENV defined in your .p

Re: [rspec-users] Spec::Rails, "model.should have(1).error_on(:attribute)"

2009-03-25 Thread David Chelimsky
On Mar 25, 2009, at 1:37 PM, Phor Gruber wrote: I added: - validates_presence_of :attribute To my model. The test now passes. Congrats! It took longer than it usually does, but you just experienced the red and green parts of the red/green/refactor cycle. Cheers, David yay!! Thanks

Re: [rspec-users] [cucumber] webrat+selenium integration problem: record n

2009-03-25 Thread Balint Erdi
Ben Mabey wrote: > Couple things I'd like to point out. In your enhanced.rb you don't need > to do the Before hook yourself. You can just require > 'database_cleaner/cucumber'. I've updated your gist to use that. > In your plain.rb it seems like you are trying to truncate your database > just o

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Tadatoshi Takahashi
Stephen Eley wrote: > On Wed, Mar 25, 2009 at 3:29 PM, Tadatoshi Takahashi > wrote: >> >> P.S. >> It seems that autospec is run against test database and that "rake spec" >> is run against development database. >> How can I resolve this problem? > > The first thing I'd check would be whether you

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Stephen Eley
On Wed, Mar 25, 2009 at 5:49 PM, Tadatoshi Takahashi wrote: > > I have never set RAILS_ENV anywhere. > To make sure, I have looked at .profile but RAILS_ENV is not set there. > > Is there any other place where that RAILS_ENV is getting set? I don't know. But the way to test it from the command l

Re: [rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

2009-03-25 Thread Mark Wilden
On Wed, Mar 25, 2009 at 2:49 PM, Tadatoshi Takahashi wrote: > Stephen Eley wrote: >> On Wed, Mar 25, 2009 at 3:29 PM, Tadatoshi Takahashi >> wrote: >>> >>> P.S. >>> It seems that autospec is run against test database and that "rake spec" >>> is run against development database. > > Is there any o

[rspec-users] Cucumber and matcher

2009-03-25 Thread Emmanuel Pinault
Hi, Is there way to generate a better error messages when I have a matcher in my step like 1.should == 0 => would fail with expected 1, got 0 I would like to add more details to that error? Especially , in my case ,I am using the include? matcher. Thanks Emmanuel _

Re: [rspec-users] [cucumber] webrat+selenium integration problem: record n

2009-03-25 Thread Balint Erdi
> Hey Ben, thanks a lot. > > The problem I am experiencing now is that information stored in the > session does not seem to be retained between steps (again, only in the > case of selenium sessions, plain sesssion work fine). So the login > function works fine now but when I go to another page

Re: [rspec-users] [cucumber] webrat+selenium integration problem: record n

2009-03-25 Thread Ben Mabey
Balint Erdi wrote: Hey Ben, thanks a lot. The problem I am experiencing now is that information stored in the session does not seem to be retained between steps (again, only in the case of selenium sessions, plain sesssion work fine). So the login function works fine now but when I go to anot

Re: [rspec-users] [cucumber] webrat+selenium integration problem: record n

2009-03-25 Thread Ben Mabey
Balint Erdi wrote: Ben Mabey wrote: Couple things I'd like to point out. In your enhanced.rb you don't need to do the Before hook yourself. You can just require 'database_cleaner/cucumber'. I've updated your gist to use that. In your plain.rb it seems like you are trying to truncate your

Re: [rspec-users] [Cucumber] ANN: Cucumber with pure Java

2009-03-25 Thread Zach Dennis
2009/3/25 Ben Mabey : > > On Mar 25, 2009, at 9:08 AM, aslak hellesoy wrote: > > Big news for all Java programmers out there. > Now you can use Cucumber with pure Java! > > That's right, you don't have to write a single line of Ruby! (1) > All of your step definitions can be written as annotated me

Re: [rspec-users] Cucumber and matcher

2009-03-25 Thread Zach Dennis
On Wed, Mar 25, 2009 at 7:18 PM, Emmanuel Pinault wrote: > Hi, > > > Is there way to generate a better error messages when I have a matcher in my > step like > > 1.should == 0  => would fail with expected 1, got 0 > > I would like to add more details to that error?  Especially , in my case ,I > am

Re: [rspec-users] Cucumber and matcher

2009-03-25 Thread David Chelimsky
On Wed, Mar 25, 2009 at 7:32 PM, Zach Dennis wrote: > On Wed, Mar 25, 2009 at 7:18 PM, Emmanuel Pinault wrote: >> Hi, >> >> >> Is there way to generate a better error messages when I have a matcher in my >> step like >> >> 1.should == 0  => would fail with expected 1, got 0 >> >> I would like to

Re: [rspec-users] [cucumber] webrat+selenium integration problem: record n

2009-03-25 Thread Balint Erdi
Ben Mabey wrote: > > With that step definition you don't need to pollute all of your features > with the steps to login. As it turns out you can have the best of both > worlds. Meaning, if you want webrat to use the faster post method only > for non-selenium runs you can. Like so: > > Given

Re: [rspec-users] How to spec a around_filter

2009-03-25 Thread Chris Flipse
I havn't done this myself, but would controller.stub!(:around_filter_method).and_yield work? On Wed, Mar 25, 2009 at 4:15 PM, Alex wrote: > Hi all, any of you guys had success specking out a around_filter? I > tried a few things like controller.should_receive > (:around_filter_method), controll

Re: [rspec-users] Cucumber and matcher

2009-03-25 Thread Emmanuel Pinault
Thanks David! I will try the new matcher after I migrate to rspec 1.2.x :) But seems a lot easier to create . Really liking it! Emmanuel On Mar 25, 2009, at 6:00 PM, David Chelimsky wrote: On Wed, Mar 25, 2009 at 7:32 PM, Zach Dennis wrote: On Wed, Mar 25, 2009 at 7:18 PM, Emmanuel Pin

[rspec-users] what's the different between ([...@weather]) and (@weather)?

2009-03-25 Thread Zhenning Guan
before do @weather = mock_model(Weather) Weather.stub!(:find).and_return([...@weather]) end I saw this code on peepcode, but I'm a little confused the and_return([...@weather]). mostly, we just and_return(@weather), don't we? so, what is the meaning of and_return([...@weather]) ? -- Posted v