diff options
-rw-r--r-- | app/views/charts/_builds.haml | 7 | ||||
-rw-r--r-- | spec/features/projects_spec.rb | 15 | ||||
-rw-r--r-- | spec/lib/charts_spec.rb | 2 |
3 files changed, 14 insertions, 10 deletions
diff --git a/app/views/charts/_builds.haml b/app/views/charts/_builds.haml index b5a70cc..ea6bc19 100644 --- a/app/views/charts/_builds.haml +++ b/app/views/charts/_builds.haml @@ -15,13 +15,6 @@ %canvas#monthChart.padded{width: 800, height: 300} %fieldset - %legend - Builds chart for last month - (#{date_from_to(Date.today - 30.days, Date.today)}) - - %canvas#monthChart.padded{width: 800, height: 300} - -%fieldset %legend Builds chart for last year %canvas#yearChart.padded{width: 800, height: 400} diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 19722dc..9eac2a1 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -32,12 +32,23 @@ describe "Projects" do it { page.should have_content 'Build Schedule' } end - describe "GET /projects/:id/chart" do + describe "GET /projects/:id/charts" do before do - visit project_charts_path(@project, 'builds') + visit project_chart_path(@project) end it { page.should have_content @project.name } + it { page.should have_content 'Builds duration chart for last 30 builds' } + end + + describe "GET /projects/:id/charts/builds" do + before do + visit project_chart_path(@project) + end + + it { page.should have_content @project.name } + it { page.should have_content 'Builds chart for last week' } + it { page.should have_content 'Builds chart for last month' } it { page.should have_content 'Builds chart for last year' } end diff --git a/spec/lib/charts_spec.rb b/spec/lib/charts_spec.rb index 4424b57..cc2c704 100644 --- a/spec/lib/charts_spec.rb +++ b/spec/lib/charts_spec.rb @@ -4,7 +4,7 @@ describe "Charts" do context "build_times" do before do - @project = Project.all.first + @project = FactoryGirl.create(:project) FactoryGirl.create(:build, :project_id => @project.id) end it { |