diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-06 17:43:59 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-06 17:43:59 +0300 |
commit | 6f15356aea488ce0085c982aac2c97cdd46db96b (patch) | |
tree | 0db6fcc11f97126bea518b708206a487f396506f /spec | |
parent | cb8b9c3fe2caba14752978f4283affc07581087c (diff) |
Add tests to release notes feature
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/releases.rb | 6 | ||||
-rw-r--r-- | spec/models/release_spec.rb | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/spec/factories/releases.rb b/spec/factories/releases.rb index 067d8138e41..80d6bbee6c7 100644 --- a/spec/factories/releases.rb +++ b/spec/factories/releases.rb @@ -2,8 +2,8 @@ FactoryGirl.define do factory :release do - tag "MyString" - description "MyText" - project_id 1 + tag "v1.1.0" + description "Awesome release" + project end end diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index e533734ba0d..527005b2b69 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -1,5 +1,16 @@ require 'rails_helper' RSpec.describe Release, type: :model do - pending "add some examples to (or delete) #{__FILE__}" + let(:release) { create(:release) } + + it { expect(release).to be_valid } + + describe 'associations' do + it { is_expected.to belong_to(:project) } + end + + describe 'validation' do + it { is_expected.to validate_presence_of(:project) } + it { is_expected.to validate_presence_of(:description) } + end end |