summaryrefslogtreecommitdiff
path: root/spec/features/projects_spec.rb
blob: 142c663b0d5bac1ac5576762997a2d0a1ffe728a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require 'spec_helper'

describe "Projects", feature: true do
  before do
    login_as :user
    @project = FactoryGirl.create :project, name: "GitLab / gitlab-shell"
  end

  describe "GET /projects", js: true do
    before do
      stub_js_gitlab_calls
      visit projects_path
    end

    it { expect(page).to have_content "GitLab / gitlab-shell" }
    it { expect(page).to have_selector ".search input#search" }
  end

  describe "GET /projects/:id" do
    before do
      visit project_path(@project)
    end

    it { expect(page).to have_content @project.name }
    it { expect(page).to have_content 'All commits' }
  end

  describe "GET /projects/:id/edit" do
    before do
      visit edit_project_path(@project)
    end

    it { expect(page).to have_content @project.name }
    it { expect(page).to have_content 'Build Schedule' }

    it "updates configuration" do
      fill_in 'Timeout', with: '70'
      click_button 'Save changes'

      expect(page).to have_content 'was successfully updated'

      find_field('Timeout').value.should eq '70'
    end
  end

  describe "GET /projects/:id/charts" do
    before do
      visit project_charts_path(@project)
    end

    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' }
  end
end