lib/bbq/test_user.rb in bbq-0.0.2 vs lib/bbq/test_user.rb in bbq-0.0.3

- old
+ new

@@ -1,16 +1,22 @@ -require 'capybara/rails' +require 'capybara/rails' if Bbq.rails? require 'capybara/dsl' require 'securerandom' require 'bbq/util' +require 'bbq/test_user/eyes' +require 'bbq/test_user/within' module Bbq class TestUser - include ActionDispatch::Routing::UrlFor - include Rails.application.routes.url_helpers - include ActionDispatch::Routing::RouteSet::MountedHelpers unless Rails.version < "3.1" + if Bbq.rails? + include ActionDispatch::Routing::UrlFor + include Rails.application.routes.url_helpers + include ActionDispatch::Routing::RouteSet::MountedHelpers unless Rails.version < "3.1" + end include Capybara::DSL + include Bbq::TestUser::Eyes + include Bbq::TestUser::Within attr_reader :options def initialize(options = {}) @session_name = options.delete(:session_name) @@ -39,16 +45,8 @@ def roles(*names) names.each do |name| module_obj = Bbq::Util.find_module(name, self) self.extend(module_obj) end - end - - def see?(*args) - args.all? { |arg| has_content?(arg) } - end - - def not_see?(*args) - args.all? { |arg| has_no_content?(arg) } end end end