Defuglify the "show updates" page.

This commit is contained in:
Miles Gould committed 2012-11-08 13:13:24 +00:00
1 parent e12bea06c3
commit a8cd45f97c
2 files changed
+9 -11

No files matched your search

+4 -7
View File
@@ -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)
+5 -4
View File
@@ -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 <p>" 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