Sha256: b8f958132320bc1c98e429ce419d7a2ad1f044e40841752536be70e066c9da3f

Contents?: true

Size: 700 Bytes

Versions: 50

Compression:

Stored size: 700 Bytes

Contents

# Put this into features/support and require it in your env.rb
#
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$/
      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

50 entries across 50 versions & 1 rubygems

Version Path
spreewald-0.5.0 examples/paths.rb
spreewald-0.4.6 examples/paths.rb
spreewald-0.4.5 examples/paths.rb
spreewald-0.4.4 examples/paths.rb
spreewald-0.4.3 examples/paths.rb
spreewald-0.4.2 examples/paths.rb
spreewald-0.4.1 examples/paths.rb
spreewald-0.4.0 examples/paths.rb
spreewald-0.3.10 examples/paths.rb
spreewald-0.3.9 examples/paths.rb
spreewald-0.3.8 examples/paths.rb
spreewald-0.3.7 examples/paths.rb
spreewald-0.3.6 examples/paths.rb
spreewald-0.3.5 examples/paths.rb
spreewald-0.3.4 examples/paths.rb
spreewald-0.3.3 examples/paths.rb
spreewald-0.3.2 examples/paths.rb
spreewald-0.3.1 examples/paths.rb
spreewald-0.3.0 examples/paths.rb
spreewald-0.2.0 examples/paths.rb