Thank you very much for the tip, Sean!

At this time, I am not inclined to apply that refactoring. As a rule of thumb, I do not extract functions into separate files until 2 files need it. This way, if I need to reference what it does or modify it I do not have to open a separate file, and others don't have to "fish for it" in the code base.

@winnipegrb committers: if you prefer it as a capybara helper, just let me know I should adjust it before you can accept the pull request, or just adjust it yourself after merging.

Thanks again for the tip, though. I am sure it will come in handy in the near future.

--
Dan Bernardic
Learn more about me at http://gravatar.com/dbernar1

> On Feb 8, 2014, at 1:55 PM, Sean Walberg <notifications@github.com> wrote:
> 
> In spec/features/sign_up_spec.rb:
> 
> >  
> > -      # fill out form and submit
> > +    it "has a form with email address, password, and password confirmation fields" do
> > +      [ 'email', 'password', 'password_confirmation' ].each do |field_name|
> > +        expect(page).to have_selector "input#user_" + field_name
> > +      end
> > +    end
> > +
> > +    it "has a link to the sign in page, for people who already have an account" do
> > +      expect(page).to have_selector "a[href='#{new_user_session_path}']"
> > +    end
> > +  end
> > +  
> > +  context "When the user signs up successfully" do
> > +    def fill_out_signup_form_and_submit
> If you're up for it, this could be extracted to a capybara helper. See http://www.elabs.se/blog/51-simple-tricks-to-clean-up-your-capybara-tests and http://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara for some details. That would let any capybara spec use this step.
> 
> —
> Reply to this email directly or view it on GitHub.