Skip to content

Commit

Permalink
added test for aspect ratio [#111 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
zr2d2 committed May 1, 2011
1 parent c7c6032 commit 867b52e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/screen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def gcd (a,b)
if b == 0
return a
end
return gcd (b, a.modulo(b) )
return gcd(b, a.modulo(b) )
end
end

7 changes: 7 additions & 0 deletions test/unit/screen_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,11 @@ class ScreenTest < ActiveSupport::TestCase
s.owner_id = 0
assert !s.valid?, "Screen owner must be valid"
end
test "that a screen has an aspect ratio" do
s = screens(:one)
s.width = 1920
s.height = 1080
assert_equal 16, s.aspect_ratio["width"]
assert_equal 9, s.aspect_ratio["height"]
end
end

0 comments on commit 867b52e

Please sign in to comment.