gitlab-org--gitlab-foss/spec/features/ci/projects_spec.rb

61 lines
1.6 KiB
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require 'spec_helper'
describe "Projects" do
2015-09-15 15:06:12 -04:00
let(:user) { create(:user) }
2015-08-25 21:42:46 -04:00
before do
2015-09-15 15:06:12 -04:00
login_as(user)
@project = FactoryGirl.create :ci_project, name: "GitLab / gitlab-shell"
@project.gl_project.team << [user, :master]
2015-08-25 21:42:46 -04:00
end
2015-09-15 15:06:12 -04:00
describe "GET /ci/projects", js: true do
2015-08-25 21:42:46 -04:00
before do
stub_js_gitlab_calls
2015-09-15 15:06:12 -04:00
visit ci_projects_path
2015-08-25 21:42:46 -04:00
end
2015-09-10 10:55:09 -04:00
it { expect(page).to have_content "GitLab / gitlab-shell" }
it { expect(page).to have_selector ".search input#search" }
2015-08-25 21:42:46 -04:00
end
2015-09-15 15:06:12 -04:00
describe "GET /ci/projects/:id" do
2015-08-25 21:42:46 -04:00
before do
2015-09-15 15:06:12 -04:00
visit ci_project_path(@project)
2015-08-25 21:42:46 -04:00
end
2015-09-10 10:55:09 -04:00
it { expect(page).to have_content @project.name }
it { expect(page).to have_content 'All commits' }
2015-08-25 21:42:46 -04:00
end
2015-09-15 15:06:12 -04:00
describe "GET /ci/projects/:id/edit" do
2015-08-25 21:42:46 -04:00
before do
2015-09-15 15:06:12 -04:00
visit edit_ci_project_path(@project)
2015-08-25 21:42:46 -04:00
end
2015-09-10 10:55:09 -04:00
it { expect(page).to have_content @project.name }
it { expect(page).to have_content 'Build Schedule' }
2015-08-25 21:42:46 -04:00
it "updates configuration" do
fill_in 'Timeout', with: '70'
click_button 'Save changes'
2015-09-10 10:55:09 -04:00
expect(page).to have_content 'was successfully updated'
2015-08-25 21:42:46 -04:00
2015-09-10 10:55:09 -04:00
expect(find_field('Timeout').value).to eq '70'
2015-08-25 21:42:46 -04:00
end
end
2015-09-15 15:06:12 -04:00
describe "GET /ci/projects/:id/charts" do
2015-08-25 21:42:46 -04:00
before do
2015-09-15 15:06:12 -04:00
visit ci_project_charts_path(@project)
2015-08-25 21:42:46 -04:00
end
2015-09-10 10:55:09 -04:00
it { expect(page).to have_content 'Overall' }
it { expect(page).to have_content 'Builds chart for last week' }
it { expect(page).to have_content 'Builds chart for last month' }
it { expect(page).to have_content 'Builds chart for last year' }
it { expect(page).to have_content 'Commit duration in minutes for last 30 commits' }
2015-08-25 21:42:46 -04:00
end
end