The test train rolls ever onwards...

This commit is contained in:
Tom Hughes 2015-03-01 17:04:39 +00:00
parent 66efc5f1ec
commit fd588cd715
25 changed files with 362 additions and 24 deletions

View file

@ -15,33 +15,34 @@ class TraceTest < ActiveSupport::TestCase
end
def test_trace_count
assert_equal 9, Trace.count
assert_equal 10, Trace.count
end
def test_visible
check_query(Trace.visible, [
:public_trace_file, :anon_trace_file, :trackable_trace_file,
:identifiable_trace_file, :zipped_trace_file, :tar_trace_file,
:tar_gzip_trace_file, :tar_bzip_trace_file
:tar_gzip_trace_file, :tar_bzip_trace_file, :pending_trace_file
])
end
def test_visible_to
check_query(Trace.visible_to(1), [
:public_trace_file, :identifiable_trace_file
:public_trace_file, :identifiable_trace_file, :pending_trace_file
])
check_query(Trace.visible_to(2), [
:public_trace_file, :anon_trace_file, :trackable_trace_file,
:identifiable_trace_file
:identifiable_trace_file, :pending_trace_file
])
check_query(Trace.visible_to(3), [
:public_trace_file, :identifiable_trace_file
:public_trace_file, :identifiable_trace_file, :pending_trace_file
])
end
def test_visible_to_all
check_query(Trace.visible_to_all, [
:public_trace_file, :identifiable_trace_file, :deleted_trace_file
:public_trace_file, :identifiable_trace_file,
:deleted_trace_file, :pending_trace_file
])
end

View file

@ -9,7 +9,7 @@ class UserPreferenceTest < ActiveSupport::TestCase
# This test needs to be updated for every addition/deletion from
# the fixture file
def test_check_count
assert_equal 2, UserPreference.count
assert_equal 4, UserPreference.count
end
# Checks that you cannot add a new preference, that is a duplicate