Skip to content

Commit

Permalink
Updated note's unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nenad-vujicic committed Jan 23, 2025
1 parent 41e41fd commit e3f82ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
26 changes: 0 additions & 26 deletions test/models/note_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ def test_closed?
assert_not_predicate create(:note, :status => "open", :closed_at => nil), :closed?
end

def test_description
comment = create(:note_comment)
assert_equal comment.body, comment.note.description

user = create(:user)
comment = create(:note_comment, :author => user)
assert_equal comment.body, comment.note.description
end

def test_author
comment = create(:note_comment)
assert_nil comment.note.author
Expand All @@ -65,23 +56,6 @@ def test_author
assert_equal user, comment.note.author
end

def test_author_id
comment = create(:note_comment)
assert_nil comment.note.author_id

user = create(:user)
comment = create(:note_comment, :author => user)
assert_equal user.id, comment.note.author_id
end

def test_author_ip
comment = create(:note_comment)
assert_nil comment.note.author_ip

comment = create(:note_comment, :author_ip => IPAddr.new("192.168.1.1"))
assert_equal IPAddr.new("192.168.1.1"), comment.note.author_ip
end

# Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05
def test_lat_lon_format
note = build(:note, :latitude => 0.00004 * GeoRecord::SCALE, :longitude => 0.00008 * GeoRecord::SCALE)
Expand Down
1 change: 0 additions & 1 deletion test/system/report_note_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class ReportNoteTest < ApplicationSystemTestCase
def test_no_link_when_not_logged_in
note = create(:note_with_comments)
visit note_path(note)
assert_content note.description

assert_no_content I18n.t("notes.show.report")
end
Expand Down

0 comments on commit e3f82ea

Please sign in to comment.