Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/acts_as_follower/followable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def followed_by?(follower)
end

def block(follower)
return if follower == self
get_follow_for(follower) ? block_existing_follow(follower) : block_future_follow(follower)
end

Expand Down
10 changes: 10 additions & 0 deletions test/acts_as_followable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ class ActsAsFollowableTest < ActiveSupport::TestCase
end

context "blocking a follower" do
context "self blocking" do
setup do
@jon.block(@jon)
end

should "not be able to block" do
assert_equal 0, @jon.blocked_followers_count
end
end

context "in my following list" do
setup do
@jon.block(@sam)
Expand Down