]> git.openstreetmap.org Git - rails.git/blob - test/models/report_test.rb
Update bundle
[rails.git] / test / models / report_test.rb
1 require "test_helper"
2
3 class ReportTest < ActiveSupport::TestCase
4   def test_issue_required
5     report = create(:report)
6
7     assert_predicate report, :valid?
8     report.issue = nil
9     assert_not_predicate report, :valid?
10   end
11
12   def test_user_required
13     report = create(:report)
14
15     assert_predicate report, :valid?
16     report.user = nil
17     assert_not_predicate report, :valid?
18   end
19
20   def test_details_required
21     report = create(:report)
22
23     assert_predicate report, :valid?
24     report.details = ""
25     assert_not_predicate report, :valid?
26   end
27
28   def test_category_required
29     report = create(:report)
30
31     assert_predicate report, :valid?
32     report.category = ""
33     assert_not_predicate report, :valid?
34   end
35
36   def test_details
37     report = create(:report)
38     assert_instance_of(RichText::Markdown, report.details)
39   end
40 end