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 +4 -0
- data/lib/osm/badge.rb +2 -2
- data/spec/osm/badge_spec.rb +3 -1
- data/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
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]
|
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=
|
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)
|
data/spec/osm/badge_spec.rb
CHANGED
@@ -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