Commit b1222ebc authored by Robert Speicher's avatar Robert Speicher

Use `:empty_project` where possible in serializer specs

parent 90e802cd
......@@ -8,7 +8,7 @@ describe AnalyticsIssueSerializer do
end
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:resource) do
{
total_time: "172802.724419",
......
......@@ -8,7 +8,7 @@ describe AnalyticsMergeRequestSerializer do
end
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:resource) do
{
total_time: "172802.724419",
......
......@@ -6,7 +6,7 @@ describe CommitEntity do
end
let(:request) { double('request') }
let(:project) { create(:project) }
let(:project) { create(:project, :repository) }
let(:commit) { project.commit }
subject { entity.as_json }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe EnvironmentSerializer do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:project) { create(:empty_project) }
let(:json) do
described_class
......@@ -11,21 +11,20 @@ describe EnvironmentSerializer do
end
context 'when there is a single object provided' do
before do
create(:ci_build, :manual, name: 'manual1',
pipeline: deployable.pipeline)
end
let(:project) { create(:project, :repository) }
let(:deployable) { create(:ci_build) }
let(:deployment) do
create(:deployment, deployable: deployable,
user: user,
project: project,
sha: project.commit.id)
end
let(:deployable) { create(:ci_build) }
let(:resource) { deployment.environment }
before do
create(:ci_build, :manual, name: 'manual1', pipeline: deployable.pipeline)
end
it 'contains important elements of environment' do
expect(json)
.to include(:name, :external_url, :environment_path, :last_deployment)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment