Sha256: c0c1ec43a06e6dd2a7aca7b6083122e9e56fa31ea591d1c80b7b51b7b4a9a11e

Contents?: true

Size: 759 Bytes

Versions: 108

Compression:

Stored size: 759 Bytes

Contents

module NavigationHelpers
  # Maps a name to a path. Used by the
  #
  #   When /^I go to (.+)$/ do |page_name|
  #
  # step definition in webrat_steps.rb
  #
  def path_to(page_name)
    case page_name
    
    when /the homepage/
      '/'
    
    when /the public feed index/
      feeds_path
    
    when /the feed admin page/
      admin_feeds_path

    when /the visit resource page/
      visit_path(Entry.first)

    # Add more mappings here.
    # Here is a more fancy example:
    #
    #   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

108 entries across 108 versions & 3 rubygems

Version Path
muck-raker-0.1.29 test/rails_root/features/support/paths.rb
muck-raker-0.1.28 test/rails_root/features/support/paths.rb
muck-raker-0.1.27 test/rails_root/features/support/paths.rb
muck-raker-0.1.22 test/rails_root/features/support/paths.rb
muck-raker-0.1.23 test/rails_root/features/support/paths.rb
muck-raker-0.1.24 test/rails_root/features/support/paths.rb
muck-raker-0.1.25 test/rails_root/features/support/paths.rb
muck-raker-0.1.26 test/rails_root/features/support/paths.rb