test/test_helper.rb
# Asserts if proper flash notices has been displayed. If no params has been
# passed then by default method asserts that there are no flash notices at
# all.
Asserts if proper flash notices has been displayed. If no params has been
passed then by default method asserts that there are no flash notices at
all.
Asserts if proper flash notices has been displayed . If no params has been passed then by default method asserts that there are no flash notices at all .
def assert_flash_notices(danger: { count: 0, text: nil },
                             success: { count: 0, text: nil },
                             info:    { count: 0, text: nil },
                             warning: { count: 0, text: nil })
      assert_select 'div.alert-danger',   count: danger[:count],
                                          text: /#{danger[:text]}/
      assert_select 'div.alert-success',  count: success[:count],
                                          text: /#{success[:text]}/
      assert_select 'div.alert-info',     count: info[:count],
                                          text: /#{info[:text]}/
      assert_select 'div.alert-warning',  count: warning[:count],
                                          text: /#{warning[:text]}/
    end
def assert_flash_notices ( danger : { count : 0 , text : nil } , success : { count : 0 , text : nil } , info : { count : 0 , text : nil } , warning : { count : 0 , text : nil } ) assert_select 'div.alert-danger' , count : danger [ :count ] , text : / #{ danger [ :text ] } / assert_select 'div.alert-success' , count : success [ :count ] , text : / #{ success [ :text ] } / assert_select 'div.alert-info' , count : info [ :count ] , text : / #{ info [ :text ] } / assert_select 'div.alert-warning' , count : warning [ :count ] , text : / #{ warning [ :text ] } / end
Asserts if proper flash notices has been displayed.
Asserts if proper flash notices has been displayed .
danger
<not_specific>
success
<not_specific>
info
<not_specific>
warning
<not_specific>