Sha256: bd9c8d01faff84c7527621382697195e477fa1c2cc7100683366cb64a7e54b30

Contents?: true

Size: 623 Bytes

Versions: 6

Compression:

Stored size: 623 Bytes

Contents

module Gaku::Testing::FlashHelpers

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

  def flash_created?
    flash? 'successfully created'
  end

  def flash_updated?
    flash? 'successfully updated'
  end

  def flash_destroyed?
    flash? 'successfully destroyed'
  end

  def flash_recovered?
    flash? 'successfully recovered'
  end

  def flash_uploaded?
    flash? 'successfully uploaded'
  end

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

end

RSpec.configure do |config|
  config.include Gaku::Testing::FlashHelpers, type: :request
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gaku_core-0.0.3 lib/gaku/testing/flash_helpers.rb
gaku-0.0.3 core/lib/gaku/testing/flash_helpers.rb
gaku-0.0.2 core/lib/gaku/testing/flash_helpers.rb
gaku_core-0.0.2 lib/gaku/testing/flash_helpers.rb
gaku-0.0.1 core/lib/gaku/testing/flash_helpers.rb
gaku_core-0.0.1 lib/gaku/testing/flash_helpers.rb