From 32f91301ef936e2870316b6355ae5d8ff3e8fd6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 26 May 2015 11:42:37 +0200 Subject: [PATCH] fix deprecation warnings in spec (cc @nlalonde) --- .../category_detailed_serializer_spec.rb | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/serializers/category_detailed_serializer_spec.rb b/spec/serializers/category_detailed_serializer_spec.rb index 67c14af3705..eeb0121c16e 100644 --- a/spec/serializers/category_detailed_serializer_spec.rb +++ b/spec/serializers/category_detailed_serializer_spec.rb @@ -7,24 +7,24 @@ describe CategoryDetailedSerializer do it "works for categories with no subcategories" do no_subcats = Fabricate(:category, topics_year: 10, topics_month: 5, topics_day: 2, posts_year: 13, posts_month: 7, posts_day: 3) json = CategoryDetailedSerializer.new(no_subcats, scope: Guardian.new, root: false).as_json - json[:topics_year].should == 10 - json[:topics_month].should == 5 - json[:topics_day].should == 2 - json[:posts_year].should == 13 - json[:posts_month].should == 7 - json[:posts_day].should == 3 + expect(json[:topics_year]).to eq(10) + expect(json[:topics_month]).to eq(5) + expect(json[:topics_day]).to eq(2) + expect(json[:posts_year]).to eq(13) + expect(json[:posts_month]).to eq(7) + expect(json[:posts_day]).to eq(3) end it "includes counts from subcategories" do parent = Fabricate(:category, topics_year: 10, topics_month: 5, topics_day: 2, posts_year: 13, posts_month: 7, posts_day: 3) subcategory = Fabricate(:category, parent_category_id: parent.id, topics_year: 1, topics_month: 1, topics_day: 1, posts_year: 1, posts_month: 1, posts_day: 1) json = CategoryDetailedSerializer.new(parent, scope: Guardian.new, root: false).as_json - json[:topics_year].should == 11 - json[:topics_month].should == 6 - json[:topics_day].should == 3 - json[:posts_year].should == 14 - json[:posts_month].should == 8 - json[:posts_day].should == 4 + expect(json[:topics_year]).to eq(11) + expect(json[:topics_month]).to eq(6) + expect(json[:topics_day]).to eq(3) + expect(json[:posts_year]).to eq(14) + expect(json[:posts_month]).to eq(8) + expect(json[:posts_day]).to eq(4) end end