summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-12-02 17:10:37 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-12-07 10:55:00 +0000
commit19e1b3246dfe085ef604c820e3bc8263e5bffd43 (patch)
treea6834727be8c33f7f22923516b6dab1be8684dba
parent186c4dd7b4f6d4edc68c6fd65703665d14877e3e (diff)
downloadgitlab-ce-19e1b3246dfe085ef604c820e3bc8263e5bffd43.tar.gz
Updates tests
Fix tests Fix rubocop error Fix broken test
-rw-r--r--spec/features/projects/builds_spec.rb42
1 files changed, 30 insertions, 12 deletions
diff --git a/spec/features/projects/builds_spec.rb b/spec/features/projects/builds_spec.rb
index f25a0abb33d..2b6ad5e3420 100644
--- a/spec/features/projects/builds_spec.rb
+++ b/spec/features/projects/builds_spec.rb
@@ -228,24 +228,42 @@ feature 'Builds', :feature do
end
end
- context "Build starts environment" do
- context "Build is successfull and has deployment" do
- it "shows a link for the build" do
- -# link to environment.name
- expect(page).to have_link()
+ context 'When build starts environment' do
+ context 'Build is successfull and has deployment' do
+ it 'shows a link for the build' do
+ environment = create(:environment, project: project)
+ 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
- context "Build is complete and not successfull" do
- it "shows a link for the build" do
- -# link to environment.name
- expect(page).to have_link()
+ context 'Build is complete and not successfull' do
+ it 'shows a link for the build' do
+ environment = create(:environment, project: project)
+ 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
- context "Build creates a new deployment" do
- it "shows a link to lastest deployment" do
- expect(page).to have_link("latest deployment")
+ context 'Build creates a new deployment' do
+ it 'shows a link to lastest deployment' do
+ 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