Sha256: b7f030c3b36091f5547473faad7092090a7b23932ac31d90aca7295ac3eec499

Contents?: true

Size: 1016 Bytes

Versions: 7

Compression:

Stored size: 1016 Bytes

Contents

require 'spec_helper'

RAW_TEAM = data_from_json 'team_success.json'

describe Dribbble::Team do
  describe 'on instance' do
    before :all do
      @team = Dribbble::Team.new 'valid_token', RAW_TEAM, '/teams/39'
    end

    describe 'after initialization' do
      RAW_TEAM.each do |field, value|
        it "respond to #{field}" do
          expect(@team.send field).to eq(value)
        end
      end
    end

    describe 'on #shots' do
      subject do
        stub_dribbble :get, '/teams/39/shots', DribbbleAPI::ShotsSuccess
        @team.shots
      end

      it 'responds with shots' do
        expect(subject.size).to eq 2
        expect(subject.first).to be_a Dribbble::Shot
      end
    end

    describe 'on #members' do
      subject do
        stub_dribbble :get, '/teams/39/members', DribbbleAPI::UsersSuccess
        @team.members
      end

      it 'responds with members' do
        expect(subject.size).to eq 1
        expect(subject.first).to be_a Dribbble::User
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dribbble-1.2.0 spec/lib/dribbble/team_spec.rb
dribbble-1.1.0 spec/lib/dribbble/team_spec.rb
dribbble-1.0.4 spec/lib/dribbble/team_spec.rb
dribbble-1.0.2 spec/lib/dribbble/team_spec.rb
dribbble-1.0.1 spec/lib/dribbble/team_spec.rb
dribbble-1.0.0 spec/lib/dribbble/team_spec.rb
dribbble-1.0.0.beta2 spec/lib/dribbble/team_spec.rb