fixed all specs; rebased.

This commit is contained in:
danielgrippi 2011-07-12 15:04:15 -07:00 committed by Raphael Sofaer
parent ce94779766
commit d1bbbdbc4c
7 changed files with 20 additions and 23 deletions

View file

@ -4,7 +4,7 @@
.span-20.append-2.prepend-2.last
#main_stream.stream.status_message_show
= render 'shared/stream_element', :post => @post, :all_aspects => @post.aspects
%br
%br
%br
= render 'shared/stream_element_shim', :post => @post, :commenting_disabled => defined?(@commenting_disabled)
%br
%br
%br

View file

@ -11,11 +11,8 @@
= link_to image_tag('deletelabel.png'), post_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete stream_element_delete", :title => t('delete')
- else
.right
- if reshare
.reshare_attribution= "reshared by #{reshare.author.name}"
.controls
= link_to image_tag('deletelabel.png'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete", :title => t('hide')
.right.controls
= link_to image_tag('deletelabel.png'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete", :title => t('hide')
.undo_text.hidden
= t('post_visibilites.update.post_hidden', :name => post.author.name)
= link_to t('undo'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete"
@ -27,6 +24,10 @@
%span.from
= person_link(post.author, :class => 'hovercardable')
%time.time.timeago{:datetime => post.created_at, :integer => time_for_sort(post).to_i}
- if reshare
%span.reshared
= "reshared by"
= person_link(reshare.author, :class => "hovercardable")
%span.details
%span.timeago

View file

@ -1,5 +1,4 @@
-if post.model.is_a?(Reshare)
= render 'shared/stream_element', :post => post.root, :all_aspects => all_aspects, :commenting_disabled => commenting_disabled, :reshare => post
-if (defined?(post.model) && post.model.is_a?(Reshare)) || post.instance_of?(Reshare)
= render 'shared/stream_element', :post => post.root, :commenting_disabled => commenting_disabled, :reshare => post
- else
= render 'shared/stream_element', :post => post, :all_aspects => all_aspects, :commenting_disabled => commenting_disabled, :reshare => nil
= render 'shared/stream_element', :post => post, :commenting_disabled => commenting_disabled, :reshare => nil

View file

@ -268,6 +268,7 @@ ActiveRecord::Schema.define(:version => 20110707234802) do
t.string "provider_display_name"
t.string "actor_url"
t.integer "objectId"
t.integer "root_id"
t.string "status_message_guid"
t.integer "likes_count", :default => 0
end

View file

@ -28,11 +28,14 @@ Feature: public repost
Scenario: shows up on the profile page
And "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice"
And I preemptively confirm the alert
And I follow "Reshare"
And I wait for the ajax to finish
And I wait for 2 seconds
Then I should see a ".reshared"
And I am on "alice@alice.alice"'s page
Then I should see "reshare this!"
Then I should see a ".reshared"
@ -45,8 +48,9 @@ Feature: public repost
And I follow "Reshare"
And I wait for the ajax to finish
And I go to the home page
Then I should see a ".reshared"
And I follow "All Aspects"
And I follow "Your Aspects"
Then I should see "reshare this!"
Then I should see a ".reshared"
And I should see "Bob"

View file

@ -376,10 +376,6 @@ ul.as-selections
&:hover
:text
:decoration none
.reshare_attribution
:font-size smaller
.reshared
:background-color #eee
.stream_element
:position relative

View file

@ -2,16 +2,13 @@ require 'spec_helper'
describe ResharesController do
describe '#create' do
it 'requires authentication' do
post :create, :format => :js
response.should_not be_success
end
context 'with an authenticated user' do
before do
sign_in :user, bob
@post_id = Factory(:status_message, :public => true).id
@controller.stub(:current_user).and_return(bob)
@ -19,7 +16,6 @@ describe ResharesController do
it 'succeeds' do
post :create, :format => :js, :root_id => @post_id
puts response.code
response.should be_success
end