Sha256: a22e795908bb72bd388ed6b7689f66f3874e77d183fb6bfc7f9f09a86600f2ff

Contents?: true

Size: 675 Bytes

Versions: 6

Compression:

Stored size: 675 Bytes

Contents

# Put this into features/support
#
module NavigationHelpers
  # Maps a name to a path. Used by the
  #
  #   When /^I go to (.+)$/ do |page_name|
  #
  # step definition in web_steps.feature
  #
  def path_to(page_name)
    case page_name

    when /^the home\s?page$/
      root_path

    else
      begin
        page_name =~ /^the (.*) page$/
        path_components = $1.split(/\s+/)
        self.send(path_components.push('path').join('_').to_sym)
      rescue NoMethodError, ArgumentError
        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

6 entries across 6 versions & 1 rubygems

Version Path
spreewald-2.5.0 examples/paths.rb
spreewald-2.4.2 examples/paths.rb
spreewald-2.4.0 examples/paths.rb
spreewald-2.3.0 examples/paths.rb
spreewald-2.2.4 examples/paths.rb
spreewald-2.2.3 examples/paths.rb