1
0
Fork 0
MSU-Course-Alerter/test/unit/alert_test.rb

33 lines
781 B
Ruby
Raw Normal View History

2013-04-02 02:43:01 -04:00
require 'test_helper'
class AlertTest < ActiveSupport::TestCase
2013-05-31 00:27:38 -04:00
def setup
@alert_one = alerts(:one)
@alert_two = alerts(:two)
@alert_three = alerts(:three)
@user_one = users(:one)
end
test "creating a new alert creates an alert" do
assert_kind_of Alert, Alert.new
end
test "should return false if has not been alerted" do
assert !@alert_one.alerted?
end
test "should return true if has been alerted" do
assert @alert_two.alerted?
end
test "should return alerts for user when asked" do
assert !Alert.user_alerts(@user_one).empty?
end
#test "should only return alerts for correct user when asked" do
# again, should test with actual user
#assert Alert.user_alerts(@user_one).all? { |a| a == @user_one }
#end
2013-04-02 02:43:01 -04:00
end