Skip to content

Commit

Permalink
Updated some tests about notification counting
Browse files Browse the repository at this point in the history
  • Loading branch information
RosselloAzcom committed Jan 15, 2020
1 parent 86a9fa4 commit 28c7a8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/integration/lib/redmine/themes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def test_with_sub_uri
# assert_select "link[rel=stylesheet][href^=?]", "/foo/themes/#{@theme.dir}/stylesheets/application.css"
# assert_select "script[src^=?]", "/foo/themes/#{@theme.dir}/javascripts/theme.js"
# assert_select 'link[rel="shortcut icon"][href^=?]', "/foo/themes/#{@theme.dir}/favicon/a.ico"
assert_select "link[rel=stylesheet]:match('href',?)", /\/foo\/(plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/stylesheets\/application\.css/
assert_select "script:match('src',?)", /\/foo\/(plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/javascripts\/theme\.js/
assert_select 'link[rel="shortcut icon"]:match("href",?)', /\/foo\/(plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/favicon\/a\.ico/
assert_select "link[rel=stylesheet]:match('href',?)", /\/foo(\/plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/stylesheets\/application\.css/
assert_select "script:match('src',?)", /\/foo(\/plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/javascripts\/theme\.js/
assert_select 'link[rel="shortcut icon"]:match("href",?)', /\/foo(\/plugin_assets\/redmine_themes)?\/themes\/#{@theme.dir}\/favicon\/a\.ico/
ensure
Redmine::Utils.relative_url_root = ''
end
Expand Down
16 changes: 12 additions & 4 deletions test/unit/journal_observer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def test_create_should_not_send_email_notification_without_issue_assignee_update
issue.assigned_to = User.find(3)

with_settings :notified_events => [] do
assert issue.save
perform_enqueued_jobs do # redmine_testsuites
assert issue.save
end
end
assert_equal 0, ActionMailer::Base.deliveries.size
end
Expand All @@ -192,7 +194,9 @@ def test_create_should_not_send_email_notification_without_issue_priority_update
issue.priority = IssuePriority.last

with_settings :notified_events => [] do
assert issue.save
perform_enqueued_jobs do # redmine_testsuites
assert issue.save
end
end
assert_equal 0, ActionMailer::Base.deliveries.size
end
Expand All @@ -204,7 +208,9 @@ def test_create_should_send_email_notification_with_issue_fixed_version_updated
issue.init_journal(user)
issue.fixed_version = versions(:versions_003)

assert issue.save
perform_enqueued_jobs do # redmine_testsuites
assert issue.save
end
assert_equal 2, ActionMailer::Base.deliveries.size
end
end
Expand All @@ -216,7 +222,9 @@ def test_create_should_not_send_email_notification_without_issue_fixed_version_u
issue.init_journal(user)
issue.fixed_version = versions(:versions_003)

assert issue.save
perform_enqueued_jobs do # redmine_testsuites
assert issue.save
end
assert_equal 0, ActionMailer::Base.deliveries.size
end
end
Expand Down

0 comments on commit 28c7a8a

Please sign in to comment.