Sha256: 7fb199644ade0563f01516c54692dc109253e5de4d028da26222b8aa6962b8e3

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe StackExchange::StackOverflow::Badge do

  describe 'when querying for badges' do
    it 'should return all badges' do
      response = StackOverflow::Badge.all

      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"
      first_badge.award_count.should == 28065
      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.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
      first_tag_based.tag_based.should be_true
      first_tag_based.badges_recipients_url.should == "/badges/204"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pilha-0.2.2 spec/pilha/stack_overflow/badge_spec.rb
pilha-0.2.1 spec/pilha/stack_overflow/badge_spec.rb
pilha-0.2.0 spec/pilha/stack_overflow/badge_spec.rb
pilha-0.1.9 spec/pilha/stack_overflow/badge_spec.rb
pilha-0.1.8 spec/pilha/stack_overflow/badge_spec.rb
pilha-0.1.7 spec/pilha/stack_overflow/badge_spec.rb