Cory O'Daniel – These are just words Software development, thoughts, and randomness

7Oct/110

Using devise’s scoped url helpers in Cucumber; new_registration_path, new_session_path

You can use devise's scoped url helpers from cucumber, but you have to use them by their real Url Helper method names:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module NavigationHelpers
  def path_to(page_name)
    case page_name
    when /the sign up page/
      # dont use the helper's helper
      # new_registration_path(:user)      
 
      # use the underlying url helper
      new_user_registration_path
    when /the sign in page/
      # dont use the helper's helper
      # new_session_path(:user)      
 
      # use the underlying url helper
      new_user_session_path
    else
      #...yada, yada

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

12Apr/111

cucumber.yml was found, but could not be parsed. Please refer to cucumber’s documentation on correct profile usage.

Yeah, I got that message today and wasted about 30 minutes of my life.

I hadn't changed my cuke yaml file since I started work on the app.

I tried:
* upgrading cucumber (FAIL)
* using another yaml file (FAIL)
* upgrading gherkin (FAIL)
* hard reseting the branch I was on (FAIL)

Turned out to just be a bum rerun.txt file. So I deleted it.

I need a refund on that 30 minutes.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

23Mar/110

Biting myself on the ass with Cucumber

So I spent a few hours today biting my own ass with cucumber.

If you are ever trying to "see" stuff in your page and notice that it has strangely disappeared, like oh say, your flash messages or validation errors. You may want to pay close attention if you are testing the page you are on just before hand.

I found out a sore lesson today, there is a big difference between:

1
2
Then I am on the sign up page
And I should see "Email can't be blank"

And

1
2
Then I should be on the sign up page
And I should see "Email can't be blank"

The difference here? "The I am on" reloads the page. I didn't know that. So I was trying to make sure I was on the right page, then checking for errors, etc. The page would reload, all my errors would be gone, and my feature was failing.

"Then I should be on" tests that the url matches the one you are on.

The more you know.

Post to Twitter Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon