mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 11:14:31 -04:00
Defuglify the "show updates" page.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user