Move created_at back a second in .post
This commit is contained in:
parent
38e44b13aa
commit
899963d487
2 changed files with 7 additions and 7 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue