Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-03 06:14:31 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-05-26 22:48:30 +0300
commit8773f339a33cf31f979013cf306e5fca5fe66a89 (patch)
tree967af00c09d604fae611e383f05e02f76d5c5680 /spec/models/snippet_spec.rb
parentc0faf91ff23815404a95cf4510b43dcf5e331c4f (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.rb10
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