diff --git a/app/views/bookmarks/_bookmark.html.haml b/app/views/bookmarks/_bookmark.html.haml index f5f9b8f4e4bd4126fcff3a4272e68e03da610f81..88a7b82f7842df0147233f8589fe19111abdd738 100644 --- a/app/views/bookmarks/_bookmark.html.haml +++ b/app/views/bookmarks/_bookmark.html.haml @@ -4,7 +4,10 @@ %b shared a link %br = post.title - = link_to post.link.to_s, post.link + /- (foo = post.link.to_s) + /- (bar = post.link) + %a{:href => "#{post.link}"} + = post.link %div.time= link_to "#{time_ago_in_words(post.updated_at)} ago", bookmark_path(post) - if mine?(post) = link_to 'Destroy', bookmark_path(post), :confirm => 'Are you sure?', :method => :delete diff --git a/app/views/shared/_post.html.haml b/app/views/posts/_post.html.haml similarity index 100% rename from app/views/shared/_post.html.haml rename to app/views/posts/_post.html.haml diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 3863720576ee0af3ceda0f71e54c0e9f8d0b83eb..bfe97c67889435648cc530f4b75215fe0bf113af 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -5,7 +5,7 @@ %div.time = "#{time_ago_in_words(post.updated_at)} ago" - if mine?(post) - /= link_to 'Destroy', status_message_path(post), :confirm => 'Are you sure?', :method => :delete + = link_to 'Destroy', status_message_path(post), :confirm => 'Are you sure?', :method => :delete diff --git a/spec/controllers/bookmarks_controller_spec.rb b/spec/controllers/bookmarks_controller_spec.rb index ba62b588c3bac88900c952359f4f5b051a57e068..0259c32d1cd0a4f15533144b75e8a690ed7d43a7 100644 --- a/spec/controllers/bookmarks_controller_spec.rb +++ b/spec/controllers/bookmarks_controller_spec.rb @@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe BookmarksController do before do #TODO(dan) Mocking Warden; this is a temp fix + request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user) @bob = Factory.build(:user) @bookmark = Factory.build(:bookmark) @@ -31,7 +32,7 @@ describe BookmarksController do it "update action should redirect when model is valid" do #TODO(dan) look into why we need to create a new bookmark object here Bookmark.any_instance.stubs(:valid?).returns(true) - n = Factory.create(:bookmark, :link => "http://hotub.com") + n = Factory.create(:bookmark, :link => "http://hotub.com/") n.save put :update, :id => Bookmark.first.id response.should redirect_to(bookmark_url(assigns[:bookmark])) diff --git a/spec/lib/common_spec.rb b/spec/lib/common_spec.rb index ec9433119f8c5bf22c543040ac7c6290e855c216..bc5bdf41ded742ac53beb7e945a882497d3fddda 100644 --- a/spec/lib/common_spec.rb +++ b/spec/lib/common_spec.rb @@ -39,7 +39,7 @@ describe Diaspora do describe "body" do before do - @post = Factory.create(:post) + @post = Factory.create(:status_message) end it "should add the following methods to Post on inclusion" do @@ -71,7 +71,7 @@ describe Diaspora do it "should check that it does not send a friends post to an owners friends" do Post.stub(:build_xml_for).and_return(true) Post.should_not_receive(:build_xml_for) - Factory.create(:post, :owner => "nottheowner@post.com") + Factory.create(:status_message, :owner => "nottheowner@post.com") end it "should ensure one url is created for every friend" do diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 79457ab03ba809a5a505f012edf6b2b887508408..f8908e23e0f8239bf54afbe164b12166fc76a796 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -10,7 +10,9 @@ describe Post do describe 'defaults' do before do - @post = Factory.create(:post, :owner => nil, :source => nil, :snippet => nil) + WebSocket.stub!(:update_clients) + @post = Factory.create(:post, :owner => nil, :source => nil, :snippet => nil) + end it "should add an owner if none is present" do