diff options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/commits_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/projects/builds_spec.rb | 38 |
3 files changed, 44 insertions, 29 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 2f82fafc13a..d92c66b689d 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -7,15 +7,16 @@ describe "Admin Runners" do describe "Runners page" do before do - runner = FactoryGirl.create(:ci_runner) + runner = FactoryGirl.create(:ci_runner, contacted_at: Time.now) pipeline = FactoryGirl.create(:ci_pipeline) FactoryGirl.create(:ci_build, pipeline: pipeline, runner_id: runner.id) visit admin_runners_path end - it { page.has_text? "Manage Runners" } - it { page.has_text? "To register a new runner" } - it { page.has_text? "Runners with last contact less than a minute ago: 1" } + it 'has all necessary texts' do + expect(page).to have_text "To register a new Runner" + expect(page).to have_text "Runners with last contact less than a minute ago: 1" + end describe 'search' do before do @@ -27,8 +28,10 @@ describe "Admin Runners" do search_form.click_button 'Search' end - it { expect(page).to have_content("runner-foo") } - it { expect(page).not_to have_content("runner-bar") } + it 'shows correct runner' do + expect(page).to have_content("runner-foo") + expect(page).not_to have_content("runner-bar") + end end end @@ -46,8 +49,10 @@ describe "Admin Runners" do end describe 'projects' do - it { expect(page).to have_content(@project1.name_with_namespace) } - it { expect(page).to have_content(@project2.name_with_namespace) } + it 'contains project names' do + expect(page).to have_content(@project1.name_with_namespace) + expect(page).to have_content(@project2.name_with_namespace) + end end describe 'search' do @@ -57,8 +62,10 @@ describe "Admin Runners" do search_form.click_button 'Search' end - it { expect(page).to have_content(@project1.name_with_namespace) } - it { expect(page).not_to have_content(@project2.name_with_namespace) } + it 'contains name of correct project' do + expect(page).to have_content(@project1.name_with_namespace) + expect(page).not_to have_content(@project2.name_with_namespace) + end end describe 'enable/create' do diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index 5910803df51..338c53f08a6 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -64,9 +64,11 @@ describe 'Commits' do visit ci_status_path(pipeline) end - it { expect(page).to have_content pipeline.sha[0..7] } - it { expect(page).to have_content pipeline.git_commit_message } - it { expect(page).to have_content pipeline.git_author_name } + it 'shows pipeline`s data' do + expect(page).to have_content pipeline.sha[0..7] + expect(page).to have_content pipeline.git_commit_message + expect(page).to have_content pipeline.git_author_name + end end context 'Download artifacts' do diff --git a/spec/features/projects/builds_spec.rb b/spec/features/projects/builds_spec.rb index d1685f95503..23ea3857dd7 100644 --- a/spec/features/projects/builds_spec.rb +++ b/spec/features/projects/builds_spec.rb @@ -79,12 +79,14 @@ describe "Builds" do click_link "Cancel running" end - it { expect(page).to have_selector('.nav-links li.active', text: 'All') } - it { expect(page).to have_content 'canceled' } - it { expect(page).to have_content @build.short_sha } - it { expect(page).to have_content @build.ref } - it { expect(page).to have_content @build.name } - it { expect(page).not_to have_link 'Cancel running' } + it 'shows all necessary content' do + expect(page).to have_selector('.nav-links li.active', text: 'All') + expect(page).to have_content 'canceled' + expect(page).to have_content @build.short_sha + expect(page).to have_content @build.ref + expect(page).to have_content @build.name + expect(page).not_to have_link 'Cancel running' + end end describe "GET /:project/builds/:id" do @@ -93,10 +95,12 @@ describe "Builds" do visit namespace_project_build_path(@project.namespace, @project, @build) end - it { expect(page.status_code).to eq(200) } - it { expect(page).to have_content @commit.sha[0..7] } - it { expect(page).to have_content @commit.git_commit_message } - it { expect(page).to have_content @commit.git_author_name } + it 'shows commit`s data' do + expect(page.status_code).to eq(200) + expect(page).to have_content @commit.sha[0..7] + expect(page).to have_content @commit.git_commit_message + expect(page).to have_content @commit.git_author_name + end end context "Build from other project" do @@ -167,7 +171,7 @@ describe "Builds" do describe 'Variables' do before do - @trigger_request = create :ci_trigger_request_with_variables + @trigger_request = create :ci_trigger_request_with_variables @build = create :ci_build, pipeline: @commit, trigger_request: @trigger_request visit namespace_project_build_path(@project.namespace, @project, @build) end @@ -176,14 +180,14 @@ describe "Builds" do expect(page).to have_css('.reveal-variables') expect(page).not_to have_css('.js-build-variable') expect(page).not_to have_css('.js-build-value') - + click_button 'Reveal Variables' expect(page).not_to have_css('.reveal-variables') expect(page).to have_selector('.js-build-variable', text: 'TRIGGER_KEY_1') expect(page).to have_selector('.js-build-value', text: 'TRIGGER_VALUE_1') end - end + end end describe "POST /:project/builds/:id/cancel" do @@ -194,9 +198,11 @@ describe "Builds" do click_link "Cancel" end - it { expect(page.status_code).to eq(200) } - it { expect(page).to have_content 'canceled' } - it { expect(page).to have_content 'Retry' } + it 'loads the page and shows all needed controls' do + expect(page.status_code).to eq(200) + expect(page).to have_content 'canceled' + expect(page).to have_content 'Retry' + end end context "Build from other project" do |