spec/popular/popular_model_spec.rb in popular-0.5.0 vs spec/popular/popular_model_spec.rb in popular-0.5.1
- old
+ new
@@ -4,9 +4,20 @@
it '.inverse_friends includes popular_models who have added an instance as a friend' do
another_popular_model.befriend popular_model
expect( popular_model ).to be_friended_by another_popular_model
end
+
+ it '#mutual_friends_with? returns false if instances are not mutual friends' do
+ expect( popular_model ).to_not be_mutual_friends_with another_popular_model
+ end
+
+ it '#mutual_friends_with? returns true if instances have befriended eachother' do
+ popular_model.befriend another_popular_model
+ another_popular_model.befriend popular_model
+
+ expect( popular_model ).to be_mutual_friends_with another_popular_model
+ end
end
describe '.befriend!' do
it 'creates a one way friendship' do
popular_model.befriend! another_popular_model