Created
March 11, 2014 12:34
-
-
Save shoaibmalik786/9484731 to your computer and use it in GitHub Desktop.
unit test model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test "set key value" do | |
assert ConfigSetting.all.size > 1 | |
end | |
test "found the value" do | |
assert_not_nil ConfigSetting.get('email') | |
end | |
test "return string value" do | |
email = ConfigSetting.get('email') | |
assert_equal email.class.to_s, "String" | |
end | |
test "return fixnum value" do | |
number = ConfigSetting.get('number') | |
assert_equal number.class.to_s, "Fixnum" | |
end | |
test "return True boolean value" do | |
flag = ConfigSetting.get('flag') | |
assert_equal flag.class.to_s, "TrueClass" | |
end | |
test "return False boolean value" do | |
flag = ConfigSetting.get('flag') | |
assert_equal flag.class.to_s, "FalseClass" | |
end | |
test "return float value" do | |
float = ConfigSetting.get('float') | |
assert_equal float.class.to_s, "Float" | |
end | |
test "incorrect key" do | |
assert_nil ConfigSetting.get('ahjmnhujhj') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment