]> git.openstreetmap.org Git - rails.git/blob - test/controllers/notifications/gpx_import_success_view_test.rb
Merge remote-tracking branch 'upstream/pull/7289'
[rails.git] / test / controllers / notifications / gpx_import_success_view_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 module Notifications
6   class GpxImportSuccessViewTest < ActionView::TestCase
7     def test_render
8       trace = build_stubbed(
9         :trace,
10         :name => "test-trace-file.gpx",
11         :description => "Test trace file"
12       )
13       notification = build_stubbed(
14         :notification,
15         :record => trace,
16         :notifier_class => GpxImportSuccessNotifier,
17         :notifier_params => {
18           :possible_points => 5
19         }
20       )
21
22       render(
23         "notifications/notification",
24         :notification => notification
25       )
26
27       assert_dom ".web-notification" do
28         assert_dom "h2", "GPS trace imported successfully"
29         assert_dom "time", "less than 1 minute ago"
30         assert_dom "dd", "test-trace-file.gpx"
31         assert_dom "dd", "Test trace file"
32         assert_dom "dd", "5"
33       end
34     end
35   end
36 end