Sha256: d78c1e364afe30837100a978e7ef17599762ce17b5ca3cf971311d0a6cb5f31f

Contents?: true

Size: 743 Bytes

Versions: 9

Compression:

Stored size: 743 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 show blogs page/
      blog_path(Blog.first)
    
    when /the create blogs page/
      new_blog_path(make_parent_params(Factory(:user)))
      
    # 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

9 entries across 9 versions & 1 rubygems

Version Path
muck-blogs-0.1.8 test/rails_root/features/support/paths.rb
muck-blogs-0.1.7 test/rails_root/features/support/paths.rb
muck-blogs-0.1.6 test/rails_root/features/support/paths.rb
muck-blogs-0.1.5 test/rails_root/features/support/paths.rb
muck-blogs-0.1.4 test/rails_root/features/support/paths.rb
muck-blogs-0.1.1 test/rails_root/features/support/paths.rb
muck-blogs-0.1.2 test/rails_root/features/support/paths.rb
muck-blogs-0.1.3 test/rails_root/features/support/paths.rb
muck-blogs-0.1.0 test/rails_root/features/support/paths.rb