-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add test for StagingProject::find
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe ObsFactory::StagingProject do | ||
let(:distribution) { ObsFactory::Distribution.new(create(:project, name: 'openSUSE:Factory')) } | ||
|
||
describe '::find' do | ||
subject { ObsFactory::StagingProject.find(distribution, '42') } | ||
|
||
context 'when there is a matching project' do | ||
let!(:project) { create(:project, name: "openSUSE:Factory:Staging:42") } | ||
|
||
it 'returns the staging project' do | ||
is_expected.to be_kind_of ObsFactory::StagingProject | ||
expect(subject.name).to eq 'openSUSE:Factory:Staging:42' | ||
expect(subject.project).to eq project | ||
expect(subject.distribution).to eq distribution | ||
end | ||
end | ||
|
||
context 'when there is no matching project' do | ||
it { is_expected.to be_nil } | ||
end | ||
end | ||
end |