search for: steps_for

Displaying 15 results from an estimated 15 matches for "steps_for".

2008 Mar 13
22
Specifing methods in a steps_for block
Hey list, I''m refactoring some much-used functionality into a common_steps step group. Methods like this are in there: steps_for :common do Given "a number of existing $types?" do |type| @initial_item_count = type.singularize.classify.constantize.count end When "the user adds an invalid $type" do |type| post "/#{type.pluralize}/create", type.to_sym => {} end When &q...
2007 Nov 15
3
How to Run Rails Stories
I have non non-plain-text story without any steps_for, can it be run? If so, how? Thanks, Nate
2008 Jun 17
1
Confused - which is the correct Story API
...-- text file mystory.story --- Story: My story description As a user I want to buy something So I have stuff Scenario: user has money and buys something Given a user has 100 dollars etc... -- Ruby file mystory.rb -- require File.join(File.dirname(__FILE__), "spec_helper") steps_for(:my_steps) do Given... When... Then... etc... end with_steps_for :my_steps do run File.expand_path(__FILE__).gsub(".rb",".story") end Now for the non-plain text stories is it this? (splitting into separate files is a YMMV thing) --- mystory.rb --- require File.join...
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
2008 Jan 16
1
session data and user stories
...on is to open a session and refer to everything afterward via the @session variable stored after open_session. it seems to be workable, but is far from ideal: dir = File.dirname(__FILE__) require ''rubygems'' require ''spec/story'' require "#{dir}/helper" steps_for(:dealer_login) do Given("I have opened a session") do @session = open_session end Given("I am not logged in") do @session.instance_variable_get("@session").should == nil end Given("I have a valid login/password combo") do...
2008 Jun 14
15
Reusing story snippets
I find myself doing this: Scenario "logged in user visiting the home page" do Given "A logged in user" do a_logged_in_user end When "..." Then "..." end The a_logged_in_user method is a helper method in helper.rb which sets up the state so that the user can browse the website. Later in the story of course, I can just do ''Given
2008 Mar 13
0
Equivalent to before(:all) for StepGroups?
...e inside each of my story steps, but would like to declare it *outside* all the steps. (It knows how to create various objects in my library, then stores a string reference to it for later steps to refer to.) Problem is, I''ve tried assigning to a module variable both inside and outside my steps_for block, and I get an error that the variable hasn''t been previously assigned when I reference it within a step block. To get it to work, I have to create the object within a step block: steps_for(:all) do #TODO: This is a total kludge. Given /an environment/ do @om = ObjectMana...
2008 Feb 29
5
outside-in = integration tests on views?
Hi, In the spirit of "outside-in" are given-when-then scenarios supposed to be integration tests of views? Or should we be accessing the model interfaces directly (not through a view)? Thanks, David :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080229/dc6b1660/attachment.html
2007 Nov 14
5
ETA to Stories
Hey guys, just poppin in to ask if anyone knows when stories will be somewhat stable? We''re starting to use integration tests at work, we''re already using rspec, and I''d like to avoid integration tests if possible. Thanks, Nate "fowlduck" Sutton
2007 Dec 31
4
How to run stories with `spec'' command?
...uestion. If I have to run stories with `ruby'' command, how can I choose the output format? (I think there''s only plain text and HTML for stories currently) Any idea? Thanks. ps: Here''s my stories ============ array.rb ============ require ''spec/story'' steps_for(:array) do Given("my state initialized") do @array = Array.new end When("$elem added to me") do |elem| @array << elem end Then("my size should be $size") do |size| @array.size.should == size.to_i end end # if __FILE__ == $0 with_steps_for...
2007 Nov 15
5
What command to run all stories?
...example stories to run with the ruby command. But I''ve been unable to get the example from http://blog.davidchelimsky.net/articles/2007/10/25/plain-text-stories-part-iii to run with all.rb ruby stories/all.rb /home/edh/story/stories/additions/steps/addition_steps.rb:2: undefined method `steps_for'' for main:Object (NoMethodError) from /home/edh/story/stories/all.rb:3:in `require'' from /home/edh/story/stories/all.rb:3 from /home/edh/story/stories/all.rb:2:in `each'' from /home/edh/story/stories/all.rb:2 from stories/all.rb:3:in...
2007 Dec 21
4
StoryRunner docs/guidance
Hi all, Are there any plans for better documentation for the new StoryRunner feature? I tried to use it today (with Rails), and had a hard time getting my head around whether I was doing it "right" and exactly what things are appropriate to test at that level (this might be exacerbated by the fact that I''ve never really used integration testing that much). A full example of
2007 Dec 22
4
StepGroup ?
Hi, I have a need for the StepGroup feature in stories but not clear what''s the current api. Could you provide an example? In my case I have several scenarios which vary in the Givens, but not the results. Ideally I''m hoping to achieve something like: (but anything will do for now :) Scenario: one Given something When he does foo Then good things should happen
2008 Jan 14
6
RSpec stories introduction
...entry is added for job and client with type "bill" And job_parties status is set to "quote" Scenario: client is held for administrative approval ... <--- I infer that I should also create a file called new_job.rb in stories and that it should contain: ---> with_steps_for :new_jobs_steps do run ''./new_job.txt'' end <--- Then I believe that I require yet another file called "new_job_steps.rb" that has code that looks somewhat like this: ---> steps_for(:new_job_steps) do Given "client exists in database" do Client.d...
2008 Jun 09
6
Selenium/Watir usage along side Webrat in story testing
...ts the smallest set of functionality - Selenium can do everything Webrat can do but not the other way around). The different UI testing frameworks implement such interface giving Selenium/Webrat/Other UI adapters. You choose which adapter to use by the story class. Example ------- #Webrat syntax steps_for(:login) do Given(''I''m logged in'') do visits ''/login'' fills_in ''username'' ''test'' fills_in ''password'' ''password'' clicks ''login'' end end #Make we...