Sha256: 5643fba7d520847fd6c9681ede3839c22f7eae2ff78614c17174d38504d3726c
Contents?: true
Size: 1.02 KB
Versions: 27
Compression:
Stored size: 1.02 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Github::Activity::Watching, '#watch' do let(:user) { 'peter-murach' } let(:repo) { 'github' } let(:request_path) { "/user/subscriptions/#{user}/#{repo}" } after { reset_authentication_for subject } context "user authenticated" do context "with correct information" do before do subject.oauth_token = OAUTH_TOKEN stub_put(request_path). with(:query => {:access_token => OAUTH_TOKEN}). to_return(:body => "", :status => 204, :headers => {}) end it "should successfully watch a repo" do subject.watch user, repo a_put(request_path).with(:query => {:access_token => OAUTH_TOKEN}). should have_been_made end end end context "user unauthenticated" do it "should fail" do stub_put(request_path).to_return(:body => "", :status => 401, :headers => {}) expect { subject.watch user, repo }.to raise_error(Github::Error::Unauthorized) end end end # watch
Version data entries
27 entries across 27 versions & 1 rubygems