Sha256: 3591f5bc89cefa142fd3b6590456a09dc2caed6bb153664758da44de23904b67

Contents?: true

Size: 753 Bytes

Versions: 10

Compression:

Stored size: 753 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 invites page/
      invite_path(Invite.first)
    
    when /the create invites page/
      new_invite_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

10 entries across 10 versions & 1 rubygems

Version Path
muck-invites-0.1.12 test/rails_root/features/support/paths.rb
muck-invites-0.1.11 test/rails_root/features/support/paths.rb
muck-invites-0.1.10 test/rails_root/features/support/paths.rb
muck-invites-0.1.7 test/rails_root/features/support/paths.rb
muck-invites-0.1.6 test/rails_root/features/support/paths.rb
muck-invites-0.1.5 test/rails_root/features/support/paths.rb
muck-invites-0.1.4 test/rails_root/features/support/paths.rb
muck-invites-0.1.3 test/rails_root/features/support/paths.rb
muck-invites-0.1.2 test/rails_root/features/support/paths.rb
muck-invites-0.1.1 test/rails_root/features/support/paths.rb