summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-21 12:32:15 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-21 12:32:15 +0200
commit29a64950dd9417452707cb8677a480a35f8da876 (patch)
tree62288a670b8a5acb7d7bebb04703a6f58e189325
parent630b666c8ff0a04881a694d4ef4723bf7f121a4e (diff)
downloadgitlab-ce-29a64950dd9417452707cb8677a480a35f8da876.tar.gz
Improve specs
-rw-r--r--spec/models/merge_request_spec.rb1
-rw-r--r--spec/models/project_spec.rb8
2 files changed, 5 insertions, 4 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 4636f2023f6..7cb97113c04 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -724,6 +724,7 @@ describe MergeRequest, models: true do
fork_project.create_forked_project_link(forked_to_project_id: fork_project.id, forked_from_project_id: project.id)
end
end
+
let(:merge_request) do
create(:merge_request,
source_project: source_project, source_branch: 'feature',
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 68f3128bf63..83f61f0af0a 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1661,11 +1661,11 @@ describe Project, models: true do
end
it 'does not return environment when no with_tags is set' do
- expect(project.environments_for('master', project.commit)).not_to contain_exactly(environment)
+ expect(project.environments_for('master', project.commit)).to be_empty
end
it 'does not return environment when commit is not part of deployment' do
- expect(project.environments_for('master', project.commit('feature'))).not_to contain_exactly(environment)
+ expect(project.environments_for('master', project.commit('feature'))).to be_empty
end
end
@@ -1679,11 +1679,11 @@ describe Project, models: true do
end
it 'does not environment when ref is different' do
- expect(project.environments_for('feature', project.commit)).not_to contain_exactly(environment)
+ expect(project.environments_for('feature', project.commit)).to be_empty
end
it 'does not return environment when commit is not part of deployment' do
- expect(project.environments_for('master', project.commit('feature'))).not_to contain_exactly(environment)
+ expect(project.environments_for('master', project.commit('feature'))).to be_empty
end
end
end