Created
February 19, 2014 19:24
-
-
Save qoobaa/9099599 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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