Module: Spree::TestingSupport::Flash

Defined in:
lib/spree/testing_support/flash.rb

Instance Method Summary collapse

Instance Method Details

#assert_flash_success(flash) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/spree/testing_support/flash.rb', line 4

def assert_flash_success(flash)
  flash = convert_flash(flash)

  within("[class='flash success']") do
    expect(page).to have_content(flash)
  end
end

#assert_successful_update_message(resource) ⇒ Object



12
13
14
15
# File 'lib/spree/testing_support/flash.rb', line 12

def assert_successful_update_message(resource)
  flash = I18n.t('spree.successfully_updated', resource: I18n.t(resource, scope: 'spree'))
  assert_flash_success(flash)
end