I need to check text message inside toastr-rails. But in my tests, text isn't show. How to run rspec with js? Or I should do something else?
scenario "#email" do
fill_in "user_email", with: "johndoe@mail.com"
click_on "Save"
expect(page).to have_content 'Your account has been updated successfully'
end
My message template(toastr)
<% unless flash.empty? %>
<script type="text/javascript">
<% flash.each do |f| %>
<% type = f[0].to_s.gsub('alert', 'error').gsub('notice', 'info') %>
toastr['<%= type %>']('<%= f[1] %>');
<% end %>
</script>