Sha256: 1934ee7d44a1003dea72912d48f9bbbb90f020868235529a80cd63dfdfa43eaf
Contents?: true
Size: 1.01 KB
Versions: 4
Compression:
Stored size: 1.01 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Github::Gists, '#unstar' do let(:gist_id) { 1 } let(:request_path) { "/gists/#{gist_id}/star" } let(:body) { '' } let(:status) { 204 } before { stub_get(request_path).to_return(:body => body, :status => status, :headers => {:content_type => "application/json; charset=utf-8"}) } after { reset_authentication_for(subject) } context 'when gist is starred' do let(:status) { 204 } it 'should raise error if gist id not present' do expect { subject.starred? nil }.to raise_error(ArgumentError) end it 'should perform request' do subject.starred? gist_id a_get(request_path).should have_been_made end it 'should return true if gist is already starred' do subject.starred?(gist_id).should be_true end end context 'when gist is not starred' do let(:status) { 404 } it 'should return false if gist is not starred' do subject.starred?(gist_id).should be_false end end end # starred?
Version data entries
4 entries across 4 versions & 1 rubygems