Webrat in Merb16 Apr 08

I've just forked Webrat to add Merb support. You can get it here.

Webrat lets you write integration tests that are even closer to natural language: you can say things like:

1  visits '/auth/login'
2  fills_in 'username',:with=>"bob"
3  fills_in 'password',:with=>"hunter2"
4  clicks_button "login"
5  response.should be_successful
6  ...

To get started, clone it, build the gem, install it, then add this to config/environments/test.rb:

1  Merb::Config.use do |c|
2    #Otherwise sessions will be lost.
3    c[:session_store] = 'memory' 
4  end  
5  dependencies "merb_stories","webrat"
TiM said on 04 Aug 2008:

Gwyn,

Looks great but a few more setup details on this would be appreciated!

Not quite sure how it fits in with rspec stories. can I replace the details in the steps with webrat commands?

Phew. spent most of the day (trying) to get this configured. About ready to sleep!~

Cheers,




Gwyn Morfey — facebookflickrtumblr — London UK