Module: RSpectacular

Defined in:
lib/rspectacular/support/garbage_collection.rb,
lib/rspectacular/version.rb,
lib/rspectacular/selectors/defaults.rb,
lib/rspectacular/plugins/rails/engine.rb,
lib/rspectacular/matchers/authentication.rb,
lib/rspectacular/matchers/active_record/date_range_matcher.rb,
lib/rspectacular/matchers/active_record/dateliness_matcher.rb,
lib/rspectacular/matchers/active_record/positivity_matcher.rb,
lib/rspectacular/matchers/active_record/persistence_matcher.rb,
lib/rspectacular/matchers/active_record/truthfulness_matcher.rb

Overview

Defined Under Namespace

Modules: ActiveRecord, Matchers, NamespacedEngineControllerRouteFix Classes: DeferredGarbageCollection

Constant Summary collapse

VERSION =
'0.43.0'

Class Method Summary collapse

Class Method Details

.default_selectorsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rspectacular/selectors/defaults.rb', line 6

def self.default_selectors
  {
    /the Facebook application/ => lambda do
      frame_element = find 'html#facebook div#pagelet_app_runner iframe'
      frame_element[:id]
    end,

    /the flash(.*)/ => lambda do |*args|
      flash_type       = args[0][/the flash(.*)/, 1]
      flash_type_class = flash_type.strip
      flash_type_class = flash_type_class.empty? ? '' : ".#{flash_type_class}"

      ".flash#{flash_type_class} p"
    end,

    ###
    # Facebook
    #
    /the Facebook login form/             => 'html#facebook form#login_form',
    /the Facebook page timeline nav bar/  => 'html#facebook #fbTimelineNavTopRow',
    /the Facebook account menu/           => '#navAccountLink',

    ###
    # PayPal
    #
    /the "Pay with PayPal" button/        => 'input[alt="Check out with PayPal"]',

    ###
    # Forms
    #
    /the errors for (.*)/                 => lambda { "#{sf $1}+div.error" },

    ###
    # Windows
    #
    /the most recently opened window/     => lambda { page.driver.browser.window_handles.last },
    /the alert dialog/                    => lambda { page.driver.browser.switch_to.alert },

    ###
    # Date Picker Buttons
    #
    /the date picker button for today/    => '.ui-datepicker-today',

    ###
    # Model Links
    #
    /the (.*) button for/                 => lambda { "##{$1.gsub(/ /, '_')}_#{args[0].class.name.underscore}_#{args[0].id}_link" }
  }
end

.selectorsObject



2
3
4
# File 'lib/rspectacular/selectors/defaults.rb', line 2

def self.selectors
  default_selectors
end