Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-19 Thread Jarmo Pertman
On Apr 18, 5:59 pm, David Chelimsky wrote: > What do you think of within(n).seconds { ... }? I'm not sure i understand it fully taking into account the examples above. Let me try to write them below: expect { link.click }.to change {div.text}.from("before").to("after").within(2).seconds link

Re: [rspec-users] added new cool matcher into my framework WatirSplash - #in

2011-04-19 Thread David Chelimsky
On Apr 19, 2011, at 3:00 AM, Jarmo Pertman wrote: > On Apr 18, 5:59 pm, David Chelimsky wrote: >> What do you think of within(n).seconds { ... }? > > I'm not sure i understand it fully taking into account the examples > above. Let me try to write them below: > expect { >link.click > }.to cha

[rspec-users] samples_table

2011-04-19 Thread Gregório Kusowski
Hey guys, I'm currently working on a project, that we use rspec. We don't like cucumber too much, because it seems too "verbose", but we like a lot the cucumber's table, that we can use to specify some scenarios. In order to use this feature, but withou using cucumber, or writing another files, I'v

[rspec-users] Faking Files, Data, Git interractions with mocks/stubs/fixtures

2011-04-19 Thread Josh N.
I'm new to ruby and just learning cucumber and rspec. I have some examples(tests) that need to fake a directory structure and file grouping, fake a properly formatted json file and fake a ruby-git interraction (git.fetch, git.merge). I've been reading about mocks and stubs but still feeling a litt

[rspec-users] "can't convert Symbol into Integer" error with Rspec and Mongoid

2011-04-19 Thread planon
I'm running into this error while trying to run a unit test on a Mongoid database: def show id=params[:id] @user=User.find(:first,id) end My test before(:each) do @user = Fabricate(:user) sign_in @user end ... it "should be successful" do get "show", :id => @user

Re: [rspec-users] "can't convert Symbol into Integer" error with Rspec and Mongoid

2011-04-19 Thread Mike Mazur
Hi, On Wed, Apr 20, 2011 at 05:32, planon wrote: > I'm running into this error while trying to run a unit test on a > Mongoid database: > >  def show >    id=params[:id] >    @user=User.find(:first,id) >  end > > My test > >  before(:each) do >    @user = Fabricate(:user) >    sign_in @user >  en

[rspec-users] how to pass command-line parameter to Rspec script?

2011-04-19 Thread Zhong
Dear all, Anyone know how to pass command-line parameter to Rspec script? For example: I want to run the test.rb script. Suppose there is a parameter that is set in test.rb script is sleep. For the convenience,I want to set the parameter for sleep in the command-line. If type : $ spec test.rb --s

[rspec-users] RSpec/Webrat Checking output is properly escaped

2011-04-19 Thread iwasrobbed
I want to test that the JSON response from a create action is sanitized properly, but rspec or webrat appears to be parsing the output into proper HTML chars instead of escaped characters. I have verified that it escapes properly in the regular browser json response. The relevant RSpec test code

Re: [rspec-users] how to pass command-line parameter to Rspec script?

2011-04-19 Thread David Chelimsky
On Apr 18, 2011, at 10:58 PM, Zhong wrote: > Dear all, > > Anyone know how to pass command-line parameter to Rspec script? > > For example: > I want to run the test.rb script. Suppose there is a parameter that is > set in test.rb script is sleep. For the convenience,I want to set the > parameter