From 899963d487e844e460349caab9fc61937c17c599 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 28 Apr 2011 12:05:59 -0700 Subject: [PATCH] Move created_at back a second in .post --- spec/controllers/tags_controller_spec.rb | 10 +++++----- spec/support/user_methods.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb index caf84e1ad..8af83537b 100644 --- a/spec/controllers/tags_controller_spec.rb +++ b/spec/controllers/tags_controller_spec.rb @@ -44,19 +44,19 @@ describe TagsController do sign_in :user, alice end it 'displays your own post' do - my_post = alice.post(:status_message, :text => "#what", :to => 'all', :created_at => Time.now - 1) + my_post = alice.post(:status_message, :text => "#what", :to => 'all') get :show, :name => 'what' assigns(:posts).models.should == [my_post] response.status.should == 200 end it "displays a friend's post" do - other_post = bob.post(:status_message, :text => "#hello", :to => 'all', :created_at => Time.now - 1) + other_post = bob.post(:status_message, :text => "#hello", :to => 'all') get :show, :name => 'hello' assigns(:posts).models.should == [other_post] response.status.should == 200 end it 'displays a public post' do - other_post = eve.post(:status_message, :text => "#hello", :public => true, :to => 'all', :created_at => Time.now - 1) + other_post = eve.post(:status_message, :text => "#hello", :public => true, :to => 'all') get :show, :name => 'hello' assigns(:posts).models.should == [other_post] response.status.should == 200 @@ -80,8 +80,8 @@ describe TagsController do end context "when there are posts to display" do before do - @post = alice.post(:status_message, :text => "#what", :public => true, :to => 'all', :created_at => Time.now - 1) - alice.post(:status_message, :text => "#hello", :public => true, :to => 'all', :created_at => Time.now - 1) + @post = alice.post(:status_message, :text => "#what", :public => true, :to => 'all') + alice.post(:status_message, :text => "#hello", :public => true, :to => 'all') end it "succeeds" do get :show, :name => 'what' diff --git a/spec/support/user_methods.rb b/spec/support/user_methods.rb index 0d8f87b05..09d067c02 100644 --- a/spec/support/user_methods.rb +++ b/spec/support/user_methods.rb @@ -23,8 +23,8 @@ class User add_to_streams(p, aspects) dispatch_post(p, :to => opts[:to]) end - if opts[:created_at] - p.created_at = opts[:created_at] + unless opts[:created_at] + p.created_at = Time.now - 1 p.save end p