spec/emotions/emotive_spec.rb in emotions-0.3 vs spec/emotions/emotive_spec.rb in emotions-0.3.1
- old
+ new
@@ -18,15 +18,13 @@
let(:picture) { Picture.create }
describe :InstanceMethods do
describe :update_emotion_counter do
- let(:relation) do
- double.tap { |double| double.stub(:count).and_return(42) }
- end
+ let(:relation) { double(count: 42) }
before do
- Picture.any_instance.stub(:happy_about).and_return(relation)
+ allow_any_instance_of(Picture).to receive(:happy_about).and_return(relation)
picture.update_emotion_counter(:happy)
end
it { expect(picture.reload.happy_emotions_count).to eql 42 }
end