]> git.openstreetmap.org Git - rails.git/blob - test/controllers/notifications/gpx_import_failure_view_test.rb
Merge remote-tracking branch 'upstream/pull/7289'
[rails.git] / test / controllers / notifications / gpx_import_failure_view_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 module Notifications
6   class GpxImportFailureViewTest < ActionView::TestCase
7     def test_render
8       notification = build_stubbed(
9         :notification,
10         :notifier_class => GpxImportFailureNotifier,
11         :notifier_params => {
12           :trace_name => "random-file.jpg",
13           :trace_description => "Random file",
14           :trace_tags => %w[random file],
15           :error => "Ooops, wrong file"
16         }
17       )
18
19       render(
20         "notifications/notification",
21         :notification => notification
22       )
23
24       assert_dom ".web-notification" do
25         assert_dom "h2", "GPS trace could not be imported"
26         assert_dom "time", "less than 1 minute ago"
27         assert_dom "dd", "random-file.jpg"
28         assert_dom "dd", "Random file"
29         assert_dom "dd", "random, file"
30         assert_dom "pre", "Ooops, wrong file"
31       end
32     end
33   end
34 end