From 943c836a9f6234faf65c44c1d62b22c4e676fffa Mon Sep 17 00:00:00 2001 From: Nick Recobra Date: Thu, 13 Jan 2011 01:25:36 +0300 Subject: [PATCH] Specs for DeployController#index. --- app/views/deploys/_table.html.haml | 2 -- spec/controllers/deploys_controller_spec.rb | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/views/deploys/_table.html.haml b/app/views/deploys/_table.html.haml index 6a70bad..18ecb5e 100644 --- a/app/views/deploys/_table.html.haml +++ b/app/views/deploys/_table.html.haml @@ -4,7 +4,6 @@ %th App %th When %th Who - %th Message %th Repository %th Revision %tbody @@ -15,6 +14,5 @@ %span.environment= deploy.environment %td.latest #{time_ago_in_words(deploy.created_at)} ago %td.who #{deploy.username} - %td.message #{deploy.message} %td.repository #{deploy.repository} %td.revision #{deploy.revision} diff --git a/spec/controllers/deploys_controller_spec.rb b/spec/controllers/deploys_controller_spec.rb index fe77f6f..9578ae3 100644 --- a/spec/controllers/deploys_controller_spec.rb +++ b/spec/controllers/deploys_controller_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' describe DeploysController do + render_views context 'POST #create' do before do @@ -38,5 +39,22 @@ describe DeploysController do end end + + context "GET #index" do + before(:each) do + @deploy = Factory :deploy + sign_in Factory(:admin) + get :index, :app_id => @deploy.app.id + end + + it "should render successfully" do + response.should be_success + end + + it "should contain info about existing deploy" do + response.body.should match(@deploy.revision) + response.body.should match(@deploy.app.name) + end + end end \ No newline at end of file -- libgit2 0.21.2