Skip to content

vspy/capybara-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CapybaraConsole

This tiny gem provides you with a Capybara console for your Rails project. Simply include it in your Gemfile:

gem 'capybara-console'

then run

rake capybara:console

and you're completely set to go REPLing with Capybara, like

> visit 'http://github.com'

or

> visit '/'

If you need something included in your console by default, create a capybara:prepare_console task:

namespace :capybara do

  task :prepare_console do

    def test_path opts 
      path = opts[:path] || '/'
      subdomain = opts[:subdomain] || 'test'
      port = Capybara.current_session.server.port
      url = "http://#{subdomain}.mytestdomain.home:#{port}#{path}"
    end

  end

end

Enjoy!

Licensed under MIT-LICENSE.

About

Capybara console for Ruby on Rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages