mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-28 04:48:49 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
35
test/unit/preference_test.rb
Normal file
35
test/unit/preference_test.rb
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class PreferenceTest < Test::Rails::TestCase
|
||||
fixtures :users, :preferences
|
||||
|
||||
def setup
|
||||
assert_equal "test", ENV['RAILS_ENV']
|
||||
assert_equal "change-me", Tracks::Config.salt
|
||||
@admin_user = User.find(1)
|
||||
@other_user = User.find(2)
|
||||
end
|
||||
|
||||
def test_time_zone
|
||||
assert_equal 'London', @admin_user.preference.time_zone
|
||||
assert_equal @admin_user.preference.tz, TimeZone['London']
|
||||
end
|
||||
|
||||
def test_show_project_on_todo_done
|
||||
assert @other_user.preference.show_project_on_todo_done
|
||||
assert !@admin_user.preference.show_project_on_todo_done
|
||||
end
|
||||
|
||||
def test_parse_date
|
||||
assert_equal Date.new(2007, 5, 20).to_s, @admin_user.preference.parse_date('20/5/2007').to_s
|
||||
end
|
||||
|
||||
def test_parse_date_returns_nil_if_string_is_empty
|
||||
assert_nil @admin_user.preference.parse_date('')
|
||||
end
|
||||
|
||||
def test_parse_date_returns_nil_if_string_is_nil
|
||||
assert_nil @admin_user.preference.parse_date(nil)
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue