spec/pilha/stack_overflow/badge_spec.rb in pilha-0.1.5 vs spec/pilha/stack_overflow/badge_spec.rb in pilha-0.1.6
- old
+ new
@@ -7,11 +7,12 @@
end
describe 'when querying for badges' do
it 'should return all badges' do
response = StackOverflow::Badge.all
- first_badge = response.first
+
+ first_badge = response.badges.first
first_badge.badge_id.should == 9
first_badge.id.should == 9
first_badge.rank.should == "bronze"
first_badge.name.should == "Autobiographer"
first_badge.description.should == "Completed all user profile fields"
@@ -19,12 +20,11 @@
first_badge.tag_based.should be_false
first_badge.badges_recipients_url.should == "/badges/9"
end
it 'should return all tag-based badges' do
-
response = StackOverflow::Badge.all(:tag_based => true)
- first_tag_based = response.first
+ first_tag_based = response.badges.first
first_tag_based.id.should == 204
first_tag_based.rank.should == "silver"
first_tag_based.name.should == ".htaccess"
first_tag_based.description.should == "Earned 400 upvotes for answers in the .htaccess tag"
first_tag_based.award_count.should == 1