diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-10 12:20:22 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-11-10 12:20:22 +0300 |
commit | 354b69dde2ba399a4269a0f544fd7a4e399d8b7e (patch) | |
tree | b44fb02b7c44cdf2fd30df907e22ad180240b873 /spec | |
parent | 2ee3f8381bd498cae52cbc0fbeb656ceae5cde9e (diff) | |
parent | b7619dad52504f8fc61bfb3b42e7f8bcc42dc06d (diff) |
Merge remote-tracking branch 'origin/release-notes'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/factories/releases.rb | 9 | ||||
-rw-r--r-- | spec/models/release_spec.rb | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/spec/factories/releases.rb b/spec/factories/releases.rb new file mode 100644 index 00000000000..80d6bbee6c7 --- /dev/null +++ b/spec/factories/releases.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :release do + tag "v1.1.0" + description "Awesome release" + project + end +end diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb new file mode 100644 index 00000000000..527005b2b69 --- /dev/null +++ b/spec/models/release_spec.rb @@ -0,0 +1,16 @@ +require 'rails_helper' + +RSpec.describe Release, type: :model do + 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 |