diff options
Diffstat (limited to 'spec/finders/releases_finder_spec.rb')
-rw-r--r-- | spec/finders/releases_finder_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/finders/releases_finder_spec.rb b/spec/finders/releases_finder_spec.rb index 3da5ee47b6b..cb4e5fed816 100644 --- a/spec/finders/releases_finder_spec.rb +++ b/spec/finders/releases_finder_spec.rb @@ -5,10 +5,11 @@ require 'spec_helper' describe ReleasesFinder do let(:user) { create(:user) } let(:project) { create(:project, :repository) } + let(:params) { {} } let(:repository) { project.repository } let(:v1_0_0) { create(:release, project: project, tag: 'v1.0.0') } let(:v1_1_0) { create(:release, project: project, tag: 'v1.1.0') } - let(:finder) { described_class.new(project, user) } + let(:finder) { described_class.new(project, user, params) } before do v1_0_0.update_attribute(:released_at, 2.days.ago) @@ -64,6 +65,14 @@ describe ReleasesFinder do expect(subject).to eq([v1_1_0]) end end + + context 'when a tag parameter is passed' do + let(:params) { { tag: 'v1.0.0' } } + + it 'only returns the release with the matching tag' do + expect(subject).to eq([v1_0_0]) + end + end end end end |