Module: Gaku::Testing::FlashHelpers

Defined in:
lib/gaku/testing/flash_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flash?(text) ⇒ Boolean

Returns:



3
4
5
# File 'lib/gaku/testing/flash_helpers.rb', line 3

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

#flash_created?Boolean

Returns:



7
8
9
# File 'lib/gaku/testing/flash_helpers.rb', line 7

def flash_created?
  flash? 'successfully created'
end

#flash_destroyed?Boolean

Returns:



15
16
17
# File 'lib/gaku/testing/flash_helpers.rb', line 15

def flash_destroyed?
  flash? 'successfully destroyed'
end

#flash_error_for(field) ⇒ Object



27
28
29
# File 'lib/gaku/testing/flash_helpers.rb', line 27

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

#flash_recovered?Boolean

Returns:



19
20
21
# File 'lib/gaku/testing/flash_helpers.rb', line 19

def flash_recovered?
  flash? 'successfully recovered'
end

#flash_updated?Boolean

Returns:



11
12
13
# File 'lib/gaku/testing/flash_helpers.rb', line 11

def flash_updated?
  flash? 'successfully updated'
end

#flash_uploaded?Boolean

Returns:



23
24
25
# File 'lib/gaku/testing/flash_helpers.rb', line 23

def flash_uploaded?
  flash? 'successfully uploaded'
end