Updates tests

Fix tests

Fix rubocop error

Fix broken test
This commit is contained in:
Filipa Lacerda 2016-12-02 17:10:37 +00:00
parent 186c4dd7b4
commit 19e1b3246d

View file

@ -228,24 +228,42 @@ feature 'Builds', :feature do
end end
end end
context "Build starts environment" do context 'When build starts environment' do
context "Build is successfull and has deployment" do context 'Build is successfull and has deployment' do
it "shows a link for the build" do it 'shows a link for the build' do
-# link to environment.name environment = create(:environment, project: project)
expect(page).to have_link() pipeline = create(:ci_pipeline, project: project)
deployment = create(:deployment)
build1 = create(:ci_build, :success, environment: environment.name, deployments: [deployment], pipeline: pipeline)
visit namespace_project_build_path(project.namespace, project, build1)
expect(page).to have_link environment.name
end end
end end
context "Build is complete and not successfull" do context 'Build is complete and not successfull' do
it "shows a link for the build" do it 'shows a link for the build' do
-# link to environment.name environment = create(:environment, project: project)
expect(page).to have_link() pipeline = create(:ci_pipeline, project: project)
build1 = create(:ci_build, :failed, environment: environment.name, pipeline: pipeline)
visit namespace_project_build_path(project.namespace, project, build1)
expect(page).to have_link environment.name
end end
end end
context "Build creates a new deployment" do context 'Build creates a new deployment' do
it "shows a link to lastest deployment" do it 'shows a link to lastest deployment' do
expect(page).to have_link("latest deployment") environment = create(:environment, project: project)
create(:deployment, environment: environment, sha: project.commit.id)
pipeline = create(:ci_pipeline, project: project)
build1 = create(:ci_build, :success, environment: environment.name, pipeline: pipeline)
visit namespace_project_build_path(project.namespace, project, build1)
expect(page).to have_link('latest deployment')
end end
end end
end end