Module: HandyFeatureHelpers::FlashHelpers

Included in:
AllHelpers
Defined in:
lib/handy_feature_helpers/flash_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flash?(text) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 4

def flash?(text)
  page.should have_selector('#notice', text: text)
end

#flash_created?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 8

def flash_created?
  flash? 'successfully created'
end

#flash_destroyed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 16

def flash_destroyed?
  flash? 'successfully destroyed'
end

#flash_error_for(field) ⇒ Object



28
29
30
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 28

def flash_error_for(field)
  page.should have_selector("div.#{field}formError")
end

#flash_recovered?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 20

def flash_recovered?
  flash? 'successfully recovered'
end

#flash_updated?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 12

def flash_updated?
  flash? 'successfully updated'
end

#flash_uploaded?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/handy_feature_helpers/flash_helpers.rb', line 24

def flash_uploaded?
  flash? 'successfully uploaded'
end