<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-1539046083268926117.post4822036637449120471..comments</id><updated>2009-12-25T00:57:15.073-08:00</updated><title type='text'>Comments on Michael Greenly: Testing Rails Authlogic with Cucumber</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.michaelgreenly.com/feeds/4822036637449120471/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html'/><author><name>Mike Greenly</name><uri>http://www.blogger.com/profile/15964361079720234778</uri><email>mgreenly@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-5921316852396775052</id><published>2009-12-25T00:57:15.073-08:00</published><updated>2009-12-25T00:57:15.073-08:00</updated><title type='text'>&gt;The short answer is yes. It's because &gt;the tests ...</title><content type='html'>&amp;gt;The short answer is yes. It&amp;#39;s because &amp;gt;the tests are run in separate &amp;gt;transactions and setting &amp;gt;&amp;quot;config.use_transactional_fixutres = &amp;gt;true&amp;quot; in your spec_helper.rb file &amp;gt;should have the effect you&amp;#39;re asking about.&lt;br /&gt;&lt;br /&gt;Mike:I tried &amp;quot;config.use_transactional_fixutres = false&amp;quot; &lt;br /&gt;but it didn&amp;#39;t work.&lt;br /&gt;&lt;br /&gt;In the features/support/env.rb file &lt;br /&gt;I also did&lt;br /&gt;Cucumber::Rails::World.use_transactional_fixtures = false ,&lt;br /&gt;but it also didn&amp;#39;t work.&lt;br /&gt;&lt;br /&gt;&amp;gt;The longer answer is that you most &amp;gt;likely don&amp;#39;t want to do that. I&amp;#39;d &amp;gt;suggest creating a new model for each &amp;gt;scenario and setting only those &amp;gt;attributes you intend to test.&lt;br /&gt;&lt;br /&gt;I am not testing model or it&amp;#39;s attributes.I am using DMA + webrat + selenium in my scenario.&lt;br /&gt;&lt;br /&gt;It&amp;#39;s a long scenario and I have to test the behaviour of application.At the start of scenario I am using DMA to create account in database.I don&amp;#39;t want to create account in database using browser by filling form as it wastes a lot of time when the scenario is being run. &lt;br /&gt;&lt;br /&gt;But the problem is account is being created after scenario is complete not at the start of scenario in the Given step.&lt;br /&gt;&lt;br /&gt;For e.g.&lt;br /&gt;Given a exists&lt;br /&gt;When I search a&lt;br /&gt;Then I should see a&lt;br /&gt; &lt;br /&gt;I am using DMA in Given step and verifying a in Then step.But it&amp;#39;s not showing a in Then step.When I am login to mysql database using console, a is present in database. I am sure it&amp;#39;s after completing of scenario as i am checking database in between when the scenario is being run.&lt;br /&gt;&lt;br /&gt;Any ideas will be appreciated....</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/5921316852396775052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/5921316852396775052'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1261731435073#c5921316852396775052' title=''/><author><name>abhay</name><uri>http://www.blogger.com/profile/02179112229594708418</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-8327483682983327169</id><published>2009-12-24T09:00:42.061-08:00</published><updated>2009-12-24T09:00:42.061-08:00</updated><title type='text'>Abhay:  The short answer is yes.  It's because the...</title><content type='html'>Abhay:  The short answer is yes.  It&amp;#39;s because the tests are run in separate transactions and setting &amp;quot;config.use_transactional_fixutres = true&amp;quot; in your spec_helper.rb file should have the effect you&amp;#39;re asking about.&lt;br /&gt;&lt;br /&gt;The longer answer is that you most likely don&amp;#39;t want to do that.  I&amp;#39;d suggest creating a new model for each scenario and setting only those attributes you intend to test. &lt;br /&gt;&lt;br /&gt;Here&amp;#39;s an example of something I&amp;#39;ve done....&lt;br /&gt;&lt;br /&gt;Scenario: do something interesting&lt;br /&gt;  Given I am the registered user &amp;quot;name&amp;quot;&lt;br /&gt;  And I my &amp;quot;attribute&amp;quot; is &amp;quot;value&amp;quot;&lt;br /&gt;&lt;br /&gt;The step definition for the first line creates a valid user model with default attributes.  Then I call the second line as many times as needed to modify only those attributes I intend to test in that specific scenario.&lt;br /&gt;&lt;br /&gt;example....&lt;br /&gt;&lt;br /&gt;Scenario: successful login&lt;br /&gt;  Given I am the registered user &amp;quot;John Doe&amp;quot;&lt;br /&gt;  And I my &amp;quot;password&amp;quot; is &amp;quot;password123&amp;quot;&lt;br /&gt;  And I my &amp;quot;email&amp;quot; is &amp;quot;jdoe@example.com&amp;quot;&lt;br /&gt;  And I my &amp;quot;role&amp;quot; is &amp;quot;admin&amp;quot;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/8327483682983327169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/8327483682983327169'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1261674042061#c8327483682983327169' title=''/><author><name>Mike Greenly</name><uri>http://www.blogger.com/profile/15964361079720234778</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02150537389679577969'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-3865503786225783998</id><published>2009-12-24T05:40:03.093-08:00</published><updated>2009-12-24T05:40:03.093-08:00</updated><title type='text'>I am working on a scenario in which i am using DMA...</title><content type='html'>I am working on a scenario in which i am using DMA to put data in database model Agent.&lt;br /&gt;I am writing this code at the start of the scenario.&lt;br /&gt;Below is the code:&lt;br /&gt;&lt;br /&gt;@person=Agent.new(:about_me=&amp;gt;&amp;quot;i am cool ,funny,passionate,sporty guy&amp;quot;,&lt;br /&gt;                      :first_name=&amp;gt;&amp;quot;abhay&amp;quot;,&lt;br /&gt;                      :last_name=&amp;gt;&amp;quot;kumar&amp;quot;,&lt;br /&gt;                      :initials=&amp;gt;&amp;quot;AK&amp;quot;,&lt;br /&gt;                      :dob=&amp;gt;&amp;quot;2009-07-07&amp;quot;,&lt;br /&gt;                      :gender=&amp;gt;&amp;quot;Male&amp;quot;,&lt;br /&gt;                      :education=&amp;gt;&amp;quot;Bachelor Degree&amp;quot;,&lt;br /&gt;                      :employment_preference=&amp;gt;&amp;quot;Permanent&amp;quot;,&lt;br /&gt;                      :current_status=&amp;gt;&amp;quot;Working&amp;quot;,&lt;br /&gt;                      :address=&amp;gt;&amp;quot;Vidydhar heights,Laxmiroad&amp;quot;,&lt;br /&gt;                      :city=&amp;gt;&amp;quot;Pune&amp;quot;,&lt;br /&gt;                      :state=&amp;gt;&amp;quot;Alaska&amp;quot;,&lt;br /&gt;                      :country=&amp;gt;&amp;quot;India&amp;quot;,&lt;br /&gt;                      :zipcode =&amp;gt;&amp;quot;412101&amp;quot;,&lt;br /&gt;                      :work_phone=&amp;gt;&amp;quot;+919767389326&amp;quot;,&lt;br /&gt;                      :primary_industry=&amp;gt;&amp;quot;Information Technology&amp;quot;,&lt;br /&gt;                      :secondary_industry=&amp;gt;&amp;quot;Information Technology&amp;quot;,                      &lt;br /&gt;                      :major=&amp;gt;&amp;quot;&amp;quot;,&lt;br /&gt;                      :mobile_phone=&amp;gt;&amp;quot;&amp;quot;,&lt;br /&gt;                      :home_phone=&amp;gt;&amp;quot;&amp;quot;,&lt;br /&gt;                      :fax_number=&amp;gt;&amp;quot;&amp;quot;&lt;br /&gt;                   &lt;br /&gt;  )&lt;br /&gt;@person.save!&lt;br /&gt;&lt;br /&gt;Interestingly data is going to mysql database after the scenario is complete.&lt;br /&gt;I need that data in between scenario but not able to access it as it&amp;#39;s not in database.&lt;br /&gt;But After the scenario is complete above row is present in database.&lt;br /&gt;&lt;br /&gt;Is there any problem with configurations of database transactions ?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/3865503786225783998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/3865503786225783998'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1261662003093#c3865503786225783998' title=''/><author><name>Abhay</name><uri>http://www.blogger.com/profile/00902862946104351403</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-6112772531365684337</id><published>2009-10-23T21:07:25.285-07:00</published><updated>2009-10-23T21:07:25.285-07:00</updated><title type='text'>This attempt is almost correct (at least in the cu...</title><content type='html'>This attempt is almost correct (at least in the current version of authlogic, v2.1). Instead of calling User.create you&amp;#39;ll want to call User.new and then save it using @user.save_without_session_maintenance.&lt;br /&gt;&lt;br /&gt;Otherwise authlogic will blow up trying to look for non-existent http request data in a non-existent controller. However nice authlogic may be, it blows Rails&amp;#39;s MVC separation all to hell.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/6112772531365684337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/6112772531365684337'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1256357245285#c6112772531365684337' title=''/><author><name>Jordan</name><uri>http://www.blogger.com/profile/14531434782317832959</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-7475063951259629183</id><published>2009-06-06T09:51:01.072-07:00</published><updated>2009-06-06T09:51:01.072-07:00</updated><title type='text'>Well, considering how many people (including me) w...</title><content type='html'>Well, considering how many people (including me) who are having problems integrating authlogic with cucumber testing, I&amp;#39;m curious to hear whether your expectations were correct..?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/7475063951259629183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/7475063951259629183'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1244307061072#c7475063951259629183' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-7064492667268054933</id><published>2009-04-19T11:29:00.000-07:00</published><updated>2009-04-19T11:29:00.000-07:00</updated><title type='text'>The visit* steps come from webrat, you'll want to ...</title><content type='html'>The visit* steps come from webrat, you'll want to install the webrat steps along w/ cucumber.  I believe the cucumber generator creates these.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/7064492667268054933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/7064492667268054933'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1240165740000#c7064492667268054933' title=''/><author><name>bantic</name><uri>http://www.blogger.com/profile/00240302409209337908</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-1539046083268926117.post-6422822452652200412</id><published>2009-04-19T09:47:00.000-07:00</published><updated>2009-04-19T09:47:00.000-07:00</updated><title type='text'>this really helps me out.. however, why aren't the...</title><content type='html'>this really helps me out.. however, why aren't the other steps listed?  i had to make a "visit path_to /the login page/" step.  ?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/6422822452652200412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1539046083268926117/4822036637449120471/comments/default/6422822452652200412'/><link rel='alternate' type='text/html' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html?showComment=1240159620000#c6422822452652200412' title=''/><author><name>Jesse</name><uri>http://www.blogger.com/profile/15430253706561827669</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.michaelgreenly.com/2009/03/rails-authentication.html' ref='tag:blogger.com,1999:blog-1539046083268926117.post-4822036637449120471' source='http://www.blogger.com/feeds/1539046083268926117/posts/default/4822036637449120471' type='text/html'/></entry></feed>