spec/osm/badges_spec.rb in osm-1.2.1 vs spec/osm/badges_spec.rb in osm-1.2.2

- old
+ new

@@ -46,11 +46,11 @@ 'type' => 'staged', 'badge' => 'participation' } } } - FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=outstandingBadges&section=cubs&sectionid=1&termid=2", :body => data.to_json) + FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=outstandingBadges&section=cubs&sectionid=1&termid=2", :body => data.to_json, :content_type => 'application/json') db = Osm::Badges.get_due_badges(@api, Osm::Section.new(:id => 1, :type => :cubs), 2) db.empty?.should == false db.badge_names.should == {'badge_name_1'=>'Badge Name', 'staged_staged_participation_2'=>'Participation (Level 2)'} db.by_member.should == {1=>['badge_name_1', 'staged_staged_participation_2'], 2=>['staged_staged_participation_2']} @@ -58,11 +58,11 @@ db.totals.should == {'staged_staged_participation_2'=>2, 'badge_name_1'=>1} db.valid?.should be_true end it "handles an empty array representing no due badges" do - FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=outstandingBadges&section=cubs&sectionid=1&termid=2", :body => '[]') + FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=outstandingBadges&section=cubs&sectionid=1&termid=2", :body => '[]', :content_type => 'application/json') db = Osm::Badges.get_due_badges(@api, Osm::Section.new(:id => 1, :type => :cubs), 2) db.should_not == nil end @@ -72,10 +72,10 @@ 'sectionid' => '1', 'badge_1' => '1', 'badge_2' => '2' } } - FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=getInitialBadges&type=core&sectionid=1&section=beavers&termid=2", :body => badges_body.to_json) + FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/challenges.php?action=getInitialBadges&type=core&sectionid=1&section=beavers&termid=2", :body => badges_body.to_json, :content_type => 'application/json') Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 2) } section = Osm::Section.new(:id => 1, :type => :beavers) Osm::Badges.get_stock(@api, section).should == {'badge_1' => 1, 'badge_2' => 2} end