require'spec_helper'describeGitlab::VisibilityLevel,lib: truedodescribe'.level_value'doit'converts "public" to integer value'doexpect(described_class.level_value('public')).toeq(Gitlab::VisibilityLevel::PUBLIC)endit'converts string integer to integer value'doexpect(described_class.level_value('20')).toeq(20)endit'defaults to PRIVATE when string value is not valid'doexpect(described_class.level_value('invalid')).toeq(Gitlab::VisibilityLevel::PRIVATE)endit'defaults to PRIVATE when integer value is not valid'doexpect(described_class.level_value(100)).toeq(Gitlab::VisibilityLevel::PRIVATE)endendend