Skip to content
Snippets Groups Projects
Commit c9583054 authored by Katarzyna Kobierska's avatar Katarzyna Kobierska
Browse files

Modify test for Build tabs

parent c220f9a0
No related branches found
No related tags found
No related merge requests found
Loading
@@ -18,11 +18,13 @@ describe "Builds" do
Loading
@@ -18,11 +18,13 @@ describe "Builds" do
visit namespace_project_builds_path(@project.namespace, @project, scope: :pending) visit namespace_project_builds_path(@project.namespace, @project, scope: :pending)
end end
   
it { expect(page).to have_link 'Cancel running' } it "shows Pending tab builds" do
it { expect(page).to have_selector('.nav-links li.active', text: 'Pending') } expect(page).to have_link 'Cancel running'
it { expect(page).to have_content @build.short_sha } expect(page).to have_selector('.nav-links li.active', text: 'Pending')
it { expect(page).to have_content @build.ref } expect(page).to have_content @build.short_sha
it { expect(page).to have_content @build.name } expect(page).to have_content @build.ref
expect(page).to have_content @build.name
end
end end
   
context "Running scope" do context "Running scope" do
Loading
@@ -31,11 +33,13 @@ describe "Builds" do
Loading
@@ -31,11 +33,13 @@ describe "Builds" do
visit namespace_project_builds_path(@project.namespace, @project, scope: :running) visit namespace_project_builds_path(@project.namespace, @project, scope: :running)
end end
   
it { expect(page).to have_selector('.nav-links li.active', text: 'Running') } it "shows Running tab builds" do
it { expect(page).to have_link 'Cancel running' } expect(page).to have_selector('.nav-links li.active', text: 'Running')
it { expect(page).to have_content @build.short_sha } expect(page).to have_link 'Cancel running'
it { expect(page).to have_content @build.ref } expect(page).to have_content @build.short_sha
it { expect(page).to have_content @build.name } expect(page).to have_content @build.ref
expect(page).to have_content @build.name
end
end end
   
context "Finished scope" do context "Finished scope" do
Loading
@@ -44,9 +48,11 @@ describe "Builds" do
Loading
@@ -44,9 +48,11 @@ describe "Builds" do
visit namespace_project_builds_path(@project.namespace, @project, scope: :finished) visit namespace_project_builds_path(@project.namespace, @project, scope: :finished)
end end
   
it { expect(page).to have_selector('.nav-links li.active', text: 'Finished') } it "shows Finished tab builds" do
it { expect(page).to have_content 'No builds to show' } expect(page).to have_selector('.nav-links li.active', text: 'Finished')
it { expect(page).to have_link 'Cancel running' } expect(page).to have_content 'No builds to show'
expect(page).to have_link 'Cancel running'
end
end end
   
context "All builds" do context "All builds" do
Loading
@@ -55,11 +61,13 @@ describe "Builds" do
Loading
@@ -55,11 +61,13 @@ describe "Builds" do
visit namespace_project_builds_path(@project.namespace, @project) visit namespace_project_builds_path(@project.namespace, @project)
end end
   
it { expect(page).to have_selector('.nav-links li.active', text: 'All') } it "shows All tab builds" do
it { expect(page).to have_content @build.short_sha } expect(page).to have_selector('.nav-links li.active', text: 'All')
it { expect(page).to have_content @build.ref } expect(page).to have_content @build.short_sha
it { expect(page).to have_content @build.name } expect(page).to have_content @build.ref
it { expect(page).not_to have_link 'Cancel running' } expect(page).to have_content @build.name
expect(page).not_to have_link 'Cancel running'
end
end end
end end
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment