<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Dry Cucumber step def]]></title>
		<link>http://railsforum.com/viewtopic.php?id=49259</link>
		<description><![CDATA[The most recent posts in Dry Cucumber step def.]]></description>
		<lastBuildDate>Sat, 15 Sep 2012 13:32:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Dry Cucumber step def]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=155432#p155432</link>
			<description><![CDATA[<p>You should use &quot;Given I fill out the Staff form properly&quot; instead of &quot;When I fill in the Staff form properly&quot;&nbsp; Your specifying the state of the page, not indicating that an event has occurred.</p><p>Here&#039;s how I&#039;d write the feature file:</p><p>Given I fill out the Staff form properly<br />When I click submit<br />Then I should see something</p><p>Given I fill out the Staff form properly<br />But I leave the last name blank<br />When I click submit<br />Then I should see error message</p><p>Here&#039;s the two Given steps:</p><p>Given /^I fill out the Staff form properly$/ do<br />&nbsp; @staff_f = Fabricate(:staff)<br />&nbsp; fill_in(&#039;staff_first_name&#039;, :with =&gt;@staff_f.first_name)<br />&nbsp; fill_in(&#039;staff_last_name&#039;, :with =&gt; @staff_f.last_name)<br />end</p><p>Given /^I leave the last name blank$/ do<br />&nbsp; fill_in(&#039;staff_last_name&#039;, :with =&gt; &quot;&quot;)<br />end</p><p>Check out: <a href="http://stackoverflow.com/questions/918066/reuse-cucumber-steps">stackoverflow - reuse cucumber steps</a></p>]]></description>
			<author><![CDATA[dummy@example.com (ToddG)]]></author>
			<pubDate>Sat, 15 Sep 2012 13:32:03 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=155432#p155432</guid>
		</item>
		<item>
			<title><![CDATA[Dry Cucumber step def]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=153472#p153472</link>
			<description><![CDATA[<p>i find myself doing allot of </p><p>i fill the XXXX form properly <br />and <br />i fill the xxx with missing field </p><div class="codebox"><pre><code>When /^I fill in the Staff form properly$/ do
  @staff_f = Fabricate(:staff)
  fill_in(&#039;staff_first_name&#039;, :with =&gt;@staff_f.first_name)
  fill_in(&#039;staff_last_name&#039;, :with =&gt; @staff_f.last_name)
end

When /^I fill in the location form with out a last name$/ do
  @staff_f = Fabricate(:staff)
  fill_in(&#039;staff_first_name&#039;, :with =&gt;@staff_f.first_name)
  fill_in(&#039;staff_last_name&#039;, :with =&gt; &quot;&quot;)
end</code></pre></div><p> </p><p>but how can i call the I fill in the Staff form properly <br />and then i remove the last name</p><p>Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (moiseszaragoza)]]></author>
			<pubDate>Thu, 21 Jun 2012 19:44:25 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=153472#p153472</guid>
		</item>
	</channel>
</rss>
