Skip to content

Instantly share code, notes, and snippets.

@qoobaa
Created February 19, 2014 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qoobaa/9099599 to your computer and use it in GitHub Desktop.
Save qoobaa/9099599 to your computer and use it in GitHub Desktop.
module TestUser
class User < SimpleDelegator
include Rails.application.routes.url_helpers
include FactoryGirl::Syntax::Methods
Capybara::Session::DSL_METHODS.each do |method|
define_method method do |*args, &block|
@session.send method, *args, &block
end
end
def initialize(user)
super
@session = Capybara::Session.new(:poltergeist, Rails.application)
end
def debug
@session.driver.debug
end
def sign_in
# ...
end
def sign_out
# ...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment