Sha256: de5acaeefe89be3d0faffd5cfbc3798d455c31760ec1dba2c7fe6044752344b1

Contents?: true

Size: 473 Bytes

Versions: 5

Compression:

Stored size: 473 Bytes

Contents

module NavigationHelpers
 def path_to(page_name)
   case page_name
   when /home page/
    root_path
  when /register/
    '/register'
   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

5 entries across 5 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/features/support/paths.rb
forge-cli-0.1.9 lib/forge/features/support/paths.rb
forge-cli-0.1.8 lib/forge/features/support/paths.rb
forge-cli-0.1.7 lib/forge/features/support/paths.rb
forge-cli-0.1.6 lib/forge/features/support/paths.rb