From 2a65d368e3b0c2ed2a788b42bb3207b82eeb1afe Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Fri, 17 Apr 2015 18:27:42 +0300 Subject: Improved test coverage --- spec/features/jobs_spec.rb | 39 +++++++++++++++++++++++++++++++++++---- spec/features/projects_spec.rb | 9 +++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) (limited to 'spec/features') diff --git a/spec/features/jobs_spec.rb b/spec/features/jobs_spec.rb index 5091df8..6945a8f 100644 --- a/spec/features/jobs_spec.rb +++ b/spec/features/jobs_spec.rb @@ -15,12 +15,23 @@ describe "Jobs" do it { page.should have_link 'Add a job' } describe 'change job script' do - before do - fill_in 'project_jobs_attributes_0_commands', with: 'Wow' + it "updates job" do + fill_in 'Script', with: 'pwd' + fill_in 'Name', with: 'New Job' + fill_in 'Tags', with: 'Tags' + check "Builds commits" + check "Build tags" + click_button 'Save changes' - end - it { page.should have_content 'successfully updated'} + page.should have_content 'successfully updated' + + find_field('Script').value.should eq 'pwd' + find_field('Name').value.should eq 'New Job' + find_field('Tags').value.should eq 'Tags' + find_field('Builds commits').should be_checked + find_field('Build tags').should be_checked + end end end @@ -32,5 +43,25 @@ describe "Jobs" do it { page.should have_content @project.name } it { page.should have_link 'Add a job' } it { page.should have_content 'Deploy jobs are scripts you want CI to run on succeeding all parallel builds' } + + describe 'change job script', js: true do + it "updates deploy job" do + click_on "Add a job" + + fill_in 'Script', with: 'pwd' + fill_in 'Name', with: 'New Job' + fill_in 'Tags', with: 'Tags' + fill_in 'Refs', with: 'master' + + click_button 'Save changes' + + page.should have_content 'successfully updated' + + find_field('Script').value.should eq 'pwd' + find_field('Name').value.should eq 'New Job' + find_field('Tags').value.should eq 'Tags' + find_field('Refs').value.should eq 'master' + end + end end end diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 034dfc1..449b322 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -31,6 +31,15 @@ describe "Projects" do it { page.should have_content @project.name } it { page.should have_content 'Build Schedule' } + + it "updates configuration" do + fill_in 'Name', with: 'Documentcloud / Underscore1' + click_button 'Save changes' + + page.should have_content 'successfully updated' + + find_field('Name').value.should eq 'Documentcloud / Underscore1' + end end describe "GET /projects/:id/charts" do -- cgit v1.2.1