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
kt-paperclip-4.4.0 features/support/paths.rb
paperclip_database-3.1.0 features/support/paths.rb
paperclip_database-3.0.0 features/support/paths.rb
paperclip_database-2.4.0 features/support/paths.rb
utf8_enforcer_workaround-1.2.1 features/support/paths.rb
utf8_enforcer_workaround-1.2.0 features/support/paths.rb
activerecord-tablefree-3.0.1 features/support/paths.rb
activerecord-tablefree-3.0.0 features/support/paths.rb
activerecord-tableless-2.0.0 features/support/paths.rb
activerecord-tableless-2.0.0.pre.2 features/support/paths.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/features/support/paths.rb
paperclip-5.1.0 features/support/paths.rb
paperclip-5.0.0 features/support/paths.rb
paperclip-4.3.7 features/support/paths.rb
paperclip_jk-5.0.0.beta2 features/support/paths.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/features/support/paths.rb
paperclip-5.0.0.beta2 features/support/paths.rb
paperclip-5.0.0.beta1 features/support/paths.rb
paperclip-4.3.6 features/support/paths.rb
paperclip-4.3.5 features/support/paths.rb