diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-03 06:14:31 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-26 22:48:30 +0300 |
commit | 8773f339a33cf31f979013cf306e5fca5fe66a89 (patch) | |
tree | 967af00c09d604fae611e383f05e02f76d5c5680 /spec/models/snippet_spec.rb | |
parent | c0faf91ff23815404a95cf4510b43dcf5e331c4f (diff) |
Minor model spec cleanups
Snippet model was missing project association
Diffstat (limited to 'spec/models/snippet_spec.rb')
-rw-r--r-- | spec/models/snippet_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 252320b798e..c81dd36ef4b 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -30,22 +30,22 @@ describe Snippet do describe 'associations' do it { is_expected.to belong_to(:author).class_name('User') } + it { is_expected.to belong_to(:project) } it { is_expected.to have_many(:notes).dependent(:destroy) } end - describe "Mass assignment" do - end - - describe "Validation" do + describe 'validation' do it { is_expected.to validate_presence_of(:author) } it { is_expected.to validate_presence_of(:title) } it { is_expected.to ensure_length_of(:title).is_within(0..255) } it { is_expected.to validate_presence_of(:file_name) } - it { is_expected.to ensure_length_of(:title).is_within(0..255) } + it { is_expected.to ensure_length_of(:file_name).is_within(0..255) } it { is_expected.to validate_presence_of(:content) } + + it { is_expected.to validate_inclusion_of(:visibility_level).in_array(Gitlab::VisibilityLevel.values) } end describe '#to_reference' do |