similar to: Reuse steps like a method call

Displaying 20 results from an estimated 3000 matches similar to: "Reuse steps like a method call"

2007 Nov 29
5
Webrat 0.1.0 released - Ruby Acceptance Testing for Web applications
Hey guys, We developed this plugin while writing my first real set of RSpec stories. It''s still missing a lot of functionality, but it''s useful to us as is, so I''m shipping 0.1.0. (Patches welcome. :) ) Code is available at: http://svn.eastmedia.net/public/plugins/webrat/ What do you think? -Bryan Here''s the README:
2008 May 11
5
Are you writing "imperative" or "declarative" scenarios in your stories?
Hey all, I just found Bryan Helmkamp''s (of webrat fame) slides on a presentation he did at GoRuCo 2008: http://www.brynary.com/2008/4/26/story-driven-development-slides-posted On slides 21-24 he talks about writing good stories and shows gives two examples.. the way not to do it and the way to do it. You can also see the video of the presentation at confreaks
2007 Mar 19
24
alias method spec?
I am completely baffled by this one - My guess is that there is no pure ruby way to do this - but how could I set up a spec to test that one method is an alias of another? Thanks for any help, Scott
2008 Nov 04
18
Can I do foo.should (be_nil || be_empty) in rspec
Is there any way to do foo.should (be_nil || be_empty) in rspec. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/ee43c9c9/attachment.html>
2008 May 13
1
user stories for load testing?
Hi all, We''ve recently been kicking around different ideas for simulating user behaviour for the purposes of load testing our backend. We hit on the idea of having user stories do double duty for both verifying behaviour and (if selected stories were driven en-masse by a distributed network of clients) for application load testing. I googled around a bit and didn''t find
2007 Apr 07
5
Integration Specs On Rails
Now that RSpec is nearing 1 dot oh, are there any plans to implement an integration testing equivalent in RSpec On Rails?
2007 Oct 18
6
spec:models depends on development db:migration
For those interested .... rake spec:models seems to clone the test database from development. If your dev db is empty, the models task fails mysteriously. Anyway, to make sure your dev db is at the current migration version, I added this dependency in lib/tasks task ''spec:models'' => ''db:migrate'' Now the dev db is migrated up with each test pass. Keith
2007 Mar 29
21
a better "should have valid associations"
This is pretty much the same as last time around, if you recall. Thanks to Wilson for converting to the new form. I''ve added a few lines. Basically, it iterates over your model associations and does two things. - First, just try to call the association. Usually fixes speeling erors or other such silliness. - Second, try to find a record with an :include on the association. This
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY out the repeated parts of my forms and put them in common/form and render the form elements via another partial in controller_name/_form. Here''s the first form # app/views/common/form <% form_for ... do |f| -%> <%= render :partial => "params[:controller]/form", :object => f
2007 Dec 20
19
Story runner rake task
What''s the status on a rake task for the story runner. If nothing is in progress, where could I start to try and build one? JD
2006 Oct 06
8
Expecting calls with two different parameters
Hello, I''ve just started using Mocha in the tests for my Rails app, and I''ve run across an issue with mocking a method that should be called with different parameters. How would I setup a mock that expects that a method will be called once with no paramaters, and a second time with a parameter? I''d be tempted to shortcut and just do something like
2008 Aug 27
3
array_including()
I found myself having to write this today: class ArrayMatcher def initialize(array_to_match) @array_to_match = array_to_match end def ==(other) ok = true @array_to_match.each do |item| ok = ok and other.include?(item) end ok end end def array_including(array_to_match) ArrayMatcher.new(array_to_match) end Is there already something in the
2008 Mar 17
8
should have_tag outside Rails
Hi Google has not helped me here. I''m looking for a way to use the have_tag assert_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Thanks Ashley -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Jan 09
6
spec not running in TextMate
I tried running a spec with command-r in TextMate and got: /Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/ lib/spec_mate.rb:1:in `require'': No such file to load -- rubygems (LoadError) from /Library/Application Support/TextMate/Bundles/ RSpec.tmbundle/Support/lib/spec_mate.rb:1 from /tmp/ temp_textmate.GplhPr:3:in `require'' from
2007 Feb 17
4
RSpec usage
Hey all, Trying to get feel for RSpec usage so I''m taking a straw poll... What''s the largest project you''ve used RSpec on in terms of app LOC app and spec LOC? Also, how long have you been using RSpec in "production" code? -Bryan
2008 May 03
9
Any news on the rSpec books?
I admit it, when it comes to rSpec, I''m lazy. I''ve made a few feeble attempts to use it, but for once I''m waiting for a book-length treatment. At least two books were announced, I think. Can anyone in the know please report on their progress? Thanks Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/
2008 Dec 16
20
step definitons to check login
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private def require_user unless current_user store_location flash[:notice] =
2008 Mar 20
5
sharing story steps
Hi, How can I have a common set of steps that all my stories share? i.e. My stories often start out looking like this: Given a user Joe Given a user Jordan then: Given("a user $username") do |username| @users ||= {} @user_sessions ||= {} @users[username] = create_user(:username => username) @user_sessions[username] = login_as(@users[username]) end I want to share that
2007 Dec 29
5
./script/story command
Below I''ve pasted a ./script/story command I''ve been using for about a week. It has three modes of operation: 1. ./script/story with no arguments will run all *.story files in the story path 2. ./script/story with a path or glob will run the specified stories 3. If input is passed in via STDIN, it runs that text as a story. This opens up story running via a simple interface
2009 Apr 02
8
Problem with Custom matcher and Blocks
Hi, I''m trying to write my first custom matcher. Here''s a bit of my example group. describe "/contact/index" do include FormMatchers before(:each) do render ''contact/index'' end it "should show the contact form" do response.should have_a_contact_form end describe "the contact form" do context