Sha256: 172b8918780c215a6ee3be94a26ca34bca05f078fd9f1029f4f208db6d4c3461

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

module NavigationHelpers
  # Maps a name to a path. Used by the
  #
  #   When /^I go to (.+)$/ do |page_name|
  #
  # step definition in web_steps.rb
  #
  def path_to(page_name)
    case page_name
    
    when /the home\s?page/
      '/'
    when /the widgets/
      '/widgets'
    
    # Add more mappings here.
    # Here is an example that pulls values out of the Regexp:
    #
    #   when /^(.*)'s profile page$/i
    #     user_profile_path(User.find_by_login($1))

    else
      raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
        "Now, go and add a mapping in #{__FILE__}"
    end
  end
end

World(NavigationHelpers)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucover-0.1.4 examples/self_test/rails/features/support/paths.rb
cucover-0.1.3 examples/self_test/rails/features/support/paths.rb
cucover-0.1.2 examples/self_test/rails/features/support/paths.rb