osm 1.2.21 → 1.2.22

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 1.2.22
2
+
3
+ * Fix marking badge as due when not passing a level
4
+
1
5
  ## Version 1.2.21
2
6
 
3
7
  * Fix updating requirement data of a Osm::Badge::Data to a blank string incorrectly returns false when the update was made into OSM
data/lib/osm/badge.rb CHANGED
@@ -516,7 +516,7 @@ module Osm
516
516
  # @!attribute [rw] first_name
517
517
  # @return [Fixnum] the member's first name
518
518
  # @!attribute [rw] last_name
519
- # @return [Fixnum] Ithe member's last name
519
+ # @return [Fixnum] the member's last name
520
520
  # @!attribute [rw] due
521
521
  # @return [Fixnum] whether this badge is due according to OSM, number indicates stage if appropriate
522
522
  # @!attribute [rw] awarded
@@ -766,7 +766,7 @@ module Osm
766
766
  # @param [Osm::Api] api The api to use to make the request
767
767
  # @param [Fixnum] level The level of the badge to award (1 for non-staged badges), setting the level to 0 unawards the badge
768
768
  # @return [Boolean] whether the data was updated in OSM
769
- def mark_due(api, level=completed)
769
+ def mark_due(api, level=earnt)
770
770
  raise ArgumentError, 'level can not be negative' if level < 0
771
771
  section = Osm::Section.get(api, section_id)
772
772
  require_ability_to(api, :write, :badge, section)
@@ -922,10 +922,12 @@ describe "Badge" do
922
922
  )
923
923
  )
924
924
 
925
- HTTParty.should_receive(:post).with(awarded_url, {:body => awarded_post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>awarded_body_data.to_json}) }
925
+ HTTParty.should_receive(:post).twice.with(awarded_url, {:body => awarded_post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>awarded_body_data.to_json}) }
926
926
  Osm::Section.stub(:get) { Osm::Section.new(:id => 2, :type => :beavers) }
927
+ data.stub(:earnt){ 1 }
927
928
 
928
929
  data.mark_due(@api, 1).should == true
930
+ data.mark_due(@api).should == true
929
931
  end
930
932
 
931
933
  it "Get summary data for a section" do
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.2.21"
2
+ VERSION = "1.2.22"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.21
4
+ version: 1.2.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: