Sha256: 4efc2b275f56e0a45f36c2c0f24a2653186bc64ea90b6e454691ab7e9244fd4b

Contents?: true

Size: 654 Bytes

Versions: 102

Compression:

Stored size: 654 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 new user page/
      '/users/new'
    else
      begin
        page_name =~ /the (.*) page/
        path_components = $1.split(/\s+/)
        self.send(path_components.push('path').join('_').to_sym)
      rescue Object => e
        raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
          "Now, go and add a mapping in #{__FILE__}"
      end
    end
  end
end

World(NavigationHelpers)

Version data entries

102 entries across 100 versions & 12 rubygems

Version Path
activerecord-tableless-1.1.2 features/support/paths.rb
activerecord-tableless-1.1.1 features/support/paths.rb
activerecord-tableless-1.1.0 features/support/paths.rb
activerecord-tableless-1.0.2 features/support/paths.rb
paperclip-2.7.5 features/support/paths.rb
paperclip-3.4.0 features/support/paths.rb
paperclip-2.7.4 features/support/paths.rb
paperclip-3.3.1 features/support/paths.rb
paperclip-2.7.2 features/support/paths.rb
paperclip-3.2.1 features/support/paths.rb
paperclip-2.8.0 features/support/paths.rb
paperclip-3.3.0 features/support/paths.rb
paperclip-2.7.1 features/support/paths.rb
paperclip_database-1.0.5 features/support/paths.rb
paperclip-3.2.0 features/support/paths.rb
utf8_enforcer_workaround-1.0.1 features/support/paths.rb
paperclip_database-1.0.4 features/support/paths.rb
paperclip_database-1.0.3 features/support/paths.rb
utf8_enforcer_workaround-1.0.0 features/support/paths.rb
utf8_enforcer_workaround-0.0.2 features/support/paths.rb