diff options
Diffstat (limited to 'spec/models/release_spec.rb')
-rw-r--r-- | spec/models/release_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index 92ba2d82f58..914fa4e2553 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -16,4 +16,18 @@ RSpec.describe Release do it { is_expected.to validate_presence_of(:project) } it { is_expected.to validate_presence_of(:description) } end + + describe '.by_tag' do + let(:tag) { release.tag } + + subject { described_class.by_tag(project, tag) } + + it { is_expected.to eq(release) } + + context 'when no releases exists' do + let(:tag) { 'not-existing' } + + it { is_expected.to be_nil } + end + end end |