From a8cd45f97ccf3ddc3a65ee80dd10596781214005 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Thu, 8 Nov 2012 13:13:24 +0000 Subject: [PATCH] Defuglify the "show updates" page. --- app/views/updates/show.html.haml | 11 ++++------- spec/views/updates/show.html.haml_spec.rb | 9 +++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/views/updates/show.html.haml b/app/views/updates/show.html.haml index f9edff482..62102857c 100644 --- a/app/views/updates/show.html.haml +++ b/app/views/updates/show.html.haml @@ -1,13 +1,10 @@ -%p#notice= notice += content_for :title, @update.subject %p - %b User: - = @update.user_id + %i + = "By #{@update.user.username} at #{@update.created_at}" + %p - %b Subject: - = @update.subject -%p - %b Body: = @update.body = link_to 'Edit', edit_update_path(@update) diff --git a/spec/views/updates/show.html.haml_spec.rb b/spec/views/updates/show.html.haml_spec.rb index d40a01585..91498bae0 100644 --- a/spec/views/updates/show.html.haml_spec.rb +++ b/spec/views/updates/show.html.haml_spec.rb @@ -2,8 +2,10 @@ require 'spec_helper' describe "updates/show" do before(:each) do + user = User.create! :username => "test_user", :email => "test@example.com", + :password => "password" @update = assign(:update, stub_model(Update, - :user_id => 1, + :user_id => user.id, :subject => "Subject", :body => "MyText" )) @@ -11,9 +13,8 @@ describe "updates/show" do it "renders attributes in

" do render - # Run the generator again with the --webrat flag if you want to use webrat matchers - rendered.should match(/1/) - rendered.should match(/Subject/) + rendered.should match(/test_user/) + # Subject goes in title rendered.should match(/MyText/) end end