Forum: RSpec Cucumber step FIT-like tables

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ee6788c2faaad7a5cd0bc466c9ea60d8?d=identicon&s=25 aidy lewis (Guest)
on 2008-10-27 19:52
(Received via mailing list)
Hi,

I am having a problem with my Cucumber step FIT-like tables.

This is my scenario

  Scenario: Filter by new files added
    Given a database update that creates an ExpiryDate that is within 30
days
    And a logged in OLC user
    When clicks 'After Sales'
    And selects 'New files added within 30 days' in the filter by drop
down
    Then verify the AE numbers of:
    | text |
    | ABHA338K |
    | ABEB702B |
    | ABBQ403P |
    | ABBQ404J |

My step implementation is:

Then /verify the AE numbers of:/ do |link_table|
      link_table.hashes.each do |hash|
      browser.link(:url, Regexp.new(hash['text'])).exist?
    end
  end

But I am getting this

Then verify the AE numbers of:
  expected 1 block argument(s), got 0 (Cucumber::ArityMismatchError)



Cheers

Aidy
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (Guest)
on 2008-10-28 05:21
(Received via mailing list)
What version/revision?

Sent from my iPhone

On 27. okt.. 2008, at 19.33, "aidy lewis" <aidy.lewis@googlemail.com>
1b32ae81cae0813e933ca2f8be830c9f?d=identicon&s=25 Chris Flipse (Guest)
on 2008-10-30 04:32
(Received via mailing list)
On Mon, Oct 27, 2008 at 2:33 PM, aidy lewis
<aidy.lewis@googlemail.com>wrote:

>    When clicks 'After Sales'
> Then /verify the AE numbers of:/ do |link_table|
>
The problem isn't with your table, it's with your step definition:
You're
telling cucumber to expect an argument, without telling it where to find
that argument.

Then /verify the AE numbers of: (\w+)/ do |link_table|
  # ....
end

and you'll need to adjust the scenario to provide a number:
Scenario: Filter by new files added
   Given a database update that creates an ExpiryDate that is within 30
days
   And a logged in OLC user
   When clicks 'After Sales'
   And selects 'New files added within 30 days' in the filter by drop
down
   Then verify the AE numbers of: ABHA338K

    # then your table goes here.
Ee6788c2faaad7a5cd0bc466c9ea60d8?d=identicon&s=25 aidy lewis (Guest)
on 2008-10-30 05:53
(Received via mailing list)
Hi Alsak,

2008/10/27 Aslak Hellesøy <aslak.hellesoy@gmail.com>:
> What version/revision?

I am on 0.1.7; I guess I need to upgrade. If this is the case, will I
need to use the Trunk or is there a gem?

Thanks

Aidy
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 aslak hellesoy (Guest)
on 2008-10-30 10:41
(Received via mailing list)
On Tue, Oct 28, 2008 at 11:43 AM, aidy lewis <aidy.lewis@googlemail.com>
wrote:
> Hi Alsak,
>
> 2008/10/27 Aslak Hellesøy <aslak.hellesoy@gmail.com>:
>> What version/revision?
>
> I am on 0.1.7; I guess I need to upgrade. If this is the case, will I
> need to use the Trunk or is there a gem?
>

Changelog:
http://github.com/aslakhellesoy/cucumber/tree/mast...
Installation instructions:
http://github.com/aslakhellesoy/cucumber/wikis

Aslak
This topic is locked and can not be replied to.