[rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-12 Thread Damian Jones
This is my story: require File.expand_path(File.dirname(__FILE__) + "/helper") Story "Creating a Product", %{ As a User I want to create a product So that I can collect purchase options together under a specific product }, :type => RailsStory do Scenario

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-12 Thread Damian Jones
David Are you saying this part should work: And "the page should show", "Product 1" do |text| response.should have_text(/#{text}/) end because I'm getting nil for this step too. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-12 Thread Damian Jones
David Chelimsky wrote: > To make that transition easy for you, I'd recommend either moving to > cucumber now, or at least taking the "decoupled step definitions" > approach within Story Runner. Check out http://pastie.org/271244 (with > the steps, story and output) and let me know if it makes sens

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-12 Thread Damian Jones
Phew, Thanks all for the input. Just need an outside eye to help me find a stupid mistake. I am using JEdit (on a windows box, unfortunately can't afford a Mac at the moment!) I had renamed Views/Product to Views/Products in JEdit but didn't realise it doesn't update the actual file system.

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-12 Thread Damian Jones
When ever I try to install a plugin from a git repository I just get: removing: ../vendor/plugins/cucumber/.git is this because I am on windows, or is there something I need to do? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list

Re: [rspec-users] cucumber gem install

2008-09-12 Thread Damian Jones
David Chelimsky wrote: > On Fri, Sep 12, 2008 at 7:46 AM, aslak hellesoy > <[EMAIL PROTECTED]> wrote: >>> C:\>gem install aslakhellesoy-cucumber >> Please get it with Git and build the gem yourself in the meanwhile. > For anyone who's not sure about how to do that: > > git clone git://github.com/a

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-13 Thread Damian Jones
David Chelimsky wrote: > On Fri, Sep 12, 2008 at 11:37 AM, David Chelimsky <[EMAIL PROTECTED]> > wrote: >>> >> script/plugin install git://github.com/aslakhellesoy/cucumber.git >> script/generate cucumber >> rake features >> >> If you still want the gem anyway, try doing it manually: >> >> git clo

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-13 Thread Damian Jones
Ok I got my story to pass by changing the follwing snippet When /I create a product named (.*) described with (.*)/ do |name, description| visits new_product_path fills_in "product[name]", :with => name fills_in "product[description]", :with => description clicks_button "Create" end don'

Re: [rspec-users] RSpec story failing because create is not rendering 'show'

2008-09-13 Thread Damian Jones
David, are you suggesting I should use the method you posted on Pastie, using stories or should I use Features as suggested on the Cucumber site? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://ru

[rspec-users] Cucumber - Ambiguous steps

2008-09-14 Thread Damian Jones
I know that cucumber does not allow ambiguous steps to stop duplication of specs, but I ran into the problem of only being a ble to use the following step name once in the whole project Then /I should see "(.*)" do |text| What can I do to get round this? -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] Cucumber - Ambiguous steps

2008-09-15 Thread Damian Jones
This is what I was trying to accomplish Then I should see "My product name" And I should see "My product description" And I should see "My product name was successfully saved." After reading all the comments above, the follwing step name solves my problem Then /I should see "(.*?)"$/ do |text|

[rspec-users] How to write a step for a feature with a select control

2008-09-16 Thread Damian Jones
I was wondering what the correct procedure would be for spec'ing the following story line When I pick "My Option" from "My Field" "My Field" would be an Article Category select control, when running my feature the control does not have any data bound to it. I am guessing I would somehow bind the

Re: [rspec-users] How to write a step for a feature with a select control

2008-09-16 Thread Damian Jones
Hi David, Once again, thanks, that is exactly what I was looking for. Thanks for clearing up the terminology also, I was hoping someone would do that. Cheers, Damian -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@r

Re: [rspec-users] How to write a step for a feature with a select control

2008-09-16 Thread Damian Jones
David Chelimsky wrote: > 2. add the data in the current step > > When(/^I pick "(.*)" from (.*)$/) do |option_value, field_name| > field_name.gsub(' > ','').constantize.find_or_create_by_name(option_value) > selects option_value, :from => field_name > end HI David, I tried the method above

Re: [rspec-users] How to write a step for a feature with a select control

2008-09-16 Thread Damian Jones
Sorry David, I don't really understand. > When(/^I pick "(.*)" from (.*)$/) do |option_value, field_name| > field_name.gsub(' ','').constantize.find_or_create_by_name(option_value) > selects option_value, :from => field_name > end >> field_name.gsub(' ','').constantize.find_or_create_by_nam

Re: [rspec-users] How to write a step for a feature with a select control

2008-09-16 Thread Damian Jones
OK, I managed to get it to work using David's option 1. > 1. add the data in a previous step > > Given /an? (.*) named "(.*)"$/ do |class_name, object_name| > class_name.gsub(' > ','').constantize.find_or_create_by_name(object_name) > end My Scenario now goes: Given an Article Category nam

Re: [rspec-users] How to write a step for a feature with a select control

2008-09-17 Thread Damian Jones
> Check out these resources: > > http://blog.davidchelimsky.net/assets/2008/7/14/IntegrationTestingWithRSpec.pdf.zip > http://www.brynary.com/uploads/Story_Driven_Development.pdf Thanks David, They are excellent resources, cleared up a lot of things for me. Damian -- Posted via http://www.r